mulmocast 1.2.43 → 1.2.44

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.
@@ -38,6 +38,11 @@ export const speakerDictionarySchema = z.record(speakerIdSchema, speakerDataSche
38
38
  lang: z.record(langSchema, speakerDataSchema).optional(),
39
39
  }));
40
40
  export const mediaSourceSchema = z.discriminatedUnion("kind", [
41
+ z.object({ kind: z.literal("url"), url: URLStringSchema }).strict(), // https://example.com/foo.pdf
42
+ z.object({ kind: z.literal("base64"), data: z.string().min(1) }).strict(), // base64
43
+ z.object({ kind: z.literal("path"), path: z.string().min(1) }).strict(), // foo.pdf
44
+ ]);
45
+ export const mediaSourceMermaidSchema = z.discriminatedUnion("kind", [
41
46
  z.object({ kind: z.literal("url"), url: URLStringSchema }).strict(), // https://example.com/foo.pdf
42
47
  z.object({ kind: z.literal("base64"), data: z.string().min(1) }).strict(), // base64
43
48
  z.object({ kind: z.literal("text"), text: z.string().min(1) }).strict(), // plain text
@@ -108,7 +113,7 @@ export const mulmoMermaidMediaSchema = z
108
113
  .object({
109
114
  type: z.literal("mermaid"),
110
115
  title: z.string().describe("The title of the diagram"),
111
- code: mediaSourceSchema.describe("The code of the mermaid diagram"),
116
+ code: mediaSourceMermaidSchema.describe("The code of the mermaid diagram"),
112
117
  appendix: z.array(z.string()).optional().describe("The appendix of the mermaid diagram; typically, style information."),
113
118
  })
114
119
  .strict();
@@ -1,5 +1,5 @@
1
1
  import { type CallbackFunction } from "graphai";
2
- import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualArraySchema, mulmoStudioMultiLingualDataSchema, mulmoStudioMultiLingualFileSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoPromptTemplateSchema, mulmoPromptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoImageAssetSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema, mulmoGoogleMovieModelSchema, mulmoReplicateMovieModelSchema, mulmoImagePromptMediaSchema } from "./schema.js";
2
+ import { langSchema, localizedTextSchema, mulmoBeatSchema, mulmoScriptSchema, mulmoStudioSchema, mulmoStudioBeatSchema, mulmoStoryboardSchema, mulmoStoryboardSceneSchema, mulmoStudioMultiLingualSchema, mulmoStudioMultiLingualArraySchema, mulmoStudioMultiLingualDataSchema, mulmoStudioMultiLingualFileSchema, speakerDictionarySchema, mulmoImageParamsSchema, mulmoImageParamsImagesSchema, mulmoFillOptionSchema, mulmoMovieParamsSchema, textSlideParamsSchema, speechOptionsSchema, speakerDataSchema, mulmoCanvasDimensionSchema, mulmoPromptTemplateSchema, mulmoPromptTemplateFileSchema, text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoPresentationStyleSchema, multiLingualTextsSchema, mulmoImageAssetSchema, mulmoMermaidMediaSchema, mulmoTextSlideMediaSchema, mulmoMarkdownMediaSchema, mulmoImageMediaSchema, mulmoChartMediaSchema, mediaSourceSchema, mediaSourceMermaidSchema, mulmoSessionStateSchema, mulmoOpenAIImageModelSchema, mulmoGoogleImageModelSchema, mulmoGoogleMovieModelSchema, mulmoReplicateMovieModelSchema, mulmoImagePromptMediaSchema } from "./schema.js";
3
3
  import { pdf_modes, pdf_sizes, storyToScriptGenerateMode } from "../utils/const.js";
4
4
  import type { LLM } from "../utils/provider2agent.js";
5
5
  import { z } from "zod";
@@ -24,6 +24,7 @@ export type MulmoStoryboardScene = z.infer<typeof mulmoStoryboardSceneSchema>;
24
24
  export type MulmoStoryboard = z.infer<typeof mulmoStoryboardSchema>;
25
25
  export type MulmoStudioBeat = z.infer<typeof mulmoStudioBeatSchema>;
26
26
  export type MulmoMediaSource = z.infer<typeof mediaSourceSchema>;
27
+ export type MulmoMediaMermaidSource = z.infer<typeof mediaSourceMermaidSchema>;
27
28
  export type MulmoStudio = z.infer<typeof mulmoStudioSchema>;
28
29
  export type MulmoPromptTemplate = z.infer<typeof mulmoPromptTemplateSchema>;
29
30
  export type MulmoPromptTemplateFile = z.infer<typeof mulmoPromptTemplateFileSchema>;
@@ -129,3 +130,4 @@ export type PublicAPIArgs = {
129
130
  settings?: Record<string, string>;
130
131
  callbacks?: CallbackFunction[];
131
132
  };
133
+ export type ImageType = "image" | "movie";
@@ -30,9 +30,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
30
30
  } | {
31
31
  kind: "base64";
32
32
  data: string;
33
- } | {
34
- text: string;
35
- kind: "text";
36
33
  } | {
37
34
  path: string;
38
35
  kind: "path";
@@ -61,9 +58,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
61
58
  } | {
62
59
  kind: "base64";
63
60
  data: string;
64
- } | {
65
- text: string;
66
- kind: "text";
67
61
  } | {
68
62
  path: string;
69
63
  kind: "path";
@@ -121,9 +115,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
121
115
  } | {
122
116
  kind: "base64";
123
117
  data: string;
124
- } | {
125
- text: string;
126
- kind: "text";
127
118
  } | {
128
119
  path: string;
129
120
  kind: "path";
@@ -136,9 +127,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
136
127
  } | {
137
128
  kind: "base64";
138
129
  data: string;
139
- } | {
140
- text: string;
141
- kind: "text";
142
130
  } | {
143
131
  path: string;
144
132
  kind: "path";
@@ -151,9 +139,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
151
139
  } | {
152
140
  kind: "base64";
153
141
  data: string;
154
- } | {
155
- text: string;
156
- kind: "text";
157
142
  } | {
158
143
  path: string;
159
144
  kind: "path";
@@ -166,9 +151,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
166
151
  } | {
167
152
  kind: "base64";
168
153
  data: string;
169
- } | {
170
- text: string;
171
- kind: "text";
172
154
  } | {
173
155
  path: string;
174
156
  kind: "path";
@@ -223,9 +205,6 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
223
205
  } | {
224
206
  kind: "base64";
225
207
  data: string;
226
- } | {
227
- text: string;
228
- kind: "text";
229
208
  } | {
230
209
  path: string;
231
210
  kind: "path";
@@ -366,9 +345,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
366
345
  } | {
367
346
  kind: "base64";
368
347
  data: string;
369
- } | {
370
- text: string;
371
- kind: "text";
372
348
  } | {
373
349
  path: string;
374
350
  kind: "path";
@@ -397,9 +373,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
397
373
  } | {
398
374
  kind: "base64";
399
375
  data: string;
400
- } | {
401
- text: string;
402
- kind: "text";
403
376
  } | {
404
377
  path: string;
405
378
  kind: "path";
@@ -457,9 +430,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
457
430
  } | {
458
431
  kind: "base64";
459
432
  data: string;
460
- } | {
461
- text: string;
462
- kind: "text";
463
433
  } | {
464
434
  path: string;
465
435
  kind: "path";
@@ -472,9 +442,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
472
442
  } | {
473
443
  kind: "base64";
474
444
  data: string;
475
- } | {
476
- text: string;
477
- kind: "text";
478
445
  } | {
479
446
  path: string;
480
447
  kind: "path";
@@ -487,9 +454,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
487
454
  } | {
488
455
  kind: "base64";
489
456
  data: string;
490
- } | {
491
- text: string;
492
- kind: "text";
493
457
  } | {
494
458
  path: string;
495
459
  kind: "path";
@@ -502,9 +466,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
502
466
  } | {
503
467
  kind: "base64";
504
468
  data: string;
505
- } | {
506
- text: string;
507
- kind: "text";
508
469
  } | {
509
470
  path: string;
510
471
  kind: "path";
@@ -559,9 +520,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
559
520
  } | {
560
521
  kind: "base64";
561
522
  data: string;
562
- } | {
563
- text: string;
564
- kind: "text";
565
523
  } | {
566
524
  path: string;
567
525
  kind: "path";
@@ -689,9 +647,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
689
647
  } | {
690
648
  kind: "base64";
691
649
  data: string;
692
- } | {
693
- text: string;
694
- kind: "text";
695
650
  } | {
696
651
  path: string;
697
652
  kind: "path";
@@ -720,9 +675,6 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
720
675
  } | {
721
676
  kind: "base64";
722
677
  data: string;
723
- } | {
724
- text: string;
725
- kind: "text";
726
678
  } | {
727
679
  path: string;
728
680
  kind: "path";
@@ -1,6 +1,5 @@
1
1
  import { GraphAILogger } from "graphai";
2
- import fs from "fs";
3
- import { readMulmoScriptFile, fetchMulmoScriptFile } from "./file.js";
2
+ import { readMulmoScriptFile, fetchMulmoScriptFile, isFile } from "./file.js";
4
3
  import { beatId, multiLingualObjectToArray } from "./utils.js";
5
4
  import { mulmoStudioSchema, mulmoCaptionParamsSchema, mulmoPresentationStyleSchema } from "../types/schema.js";
6
5
  import { MulmoPresentationStyleMethods, MulmoScriptMethods, MulmoStudioMultiLingualMethod } from "../methods/index.js";
@@ -86,14 +85,14 @@ export const fetchScript = async (isHttpPath, mulmoFilePath, fileOrUrl) => {
86
85
  }
87
86
  return res.script;
88
87
  }
89
- if (!fs.existsSync(mulmoFilePath)) {
88
+ if (!isFile(mulmoFilePath)) {
90
89
  GraphAILogger.info(`ERROR: File not exists ${mulmoFilePath}`);
91
90
  return null;
92
91
  }
93
92
  return readMulmoScriptFile(mulmoFilePath, "ERROR: File does not exist " + mulmoFilePath)?.mulmoData ?? null;
94
93
  };
95
94
  export const getMultiLingual = (multilingualFilePath, beats) => {
96
- if (!fs.existsSync(multilingualFilePath)) {
95
+ if (!isFile(multilingualFilePath)) {
97
96
  return beats.reduce((tmp, beat, index) => {
98
97
  const key = beatId(beat?.id, index);
99
98
  tmp[key] = { multiLingualTexts: {} };
@@ -107,7 +106,7 @@ export const getPresentationStyle = (presentationStylePath) => {
107
106
  if (!presentationStylePath) {
108
107
  return null;
109
108
  }
110
- if (!fs.existsSync(presentationStylePath)) {
109
+ if (!isFile(presentationStylePath)) {
111
110
  throw new Error(`ERROR: File not exists ${presentationStylePath}`);
112
111
  }
113
112
  const jsonData = readMulmoScriptFile(presentationStylePath, "ERROR: File does not exist " + presentationStylePath)?.mulmoData ?? null;
@@ -0,0 +1,69 @@
1
+ export declare const getAudioInputIdsError: (index: number, fileName: string) => {
2
+ type: string;
3
+ action: string;
4
+ target: string;
5
+ agentName: string;
6
+ beatIndex: number;
7
+ fileName: string;
8
+ };
9
+ export declare const audioCheckerError: (index: number, fileName: string) => {
10
+ type: string;
11
+ action: string;
12
+ target: string;
13
+ agentName: string;
14
+ beatIndex: number;
15
+ fileName: string;
16
+ };
17
+ export declare const createVideoSourceError: (index: number) => {
18
+ type: string;
19
+ action: string;
20
+ agentName: string;
21
+ beatIndex: number;
22
+ };
23
+ export declare const invalidAudioSourceError: (beatIndex: number) => {
24
+ type: string;
25
+ action: string;
26
+ target: string;
27
+ agentName: string;
28
+ beatIndex: number;
29
+ };
30
+ export declare const createVideoFileError: (index: number, fileName: string) => {
31
+ type: string;
32
+ action: string;
33
+ target: string;
34
+ agentName: string;
35
+ beatIndex: number;
36
+ fileName: string;
37
+ };
38
+ export declare const downLoadReferenceImageError: (key: string, url: string) => {
39
+ type: string;
40
+ action: string;
41
+ target: string;
42
+ agentName: string;
43
+ key: string;
44
+ url: string;
45
+ };
46
+ export declare const downloadImagePluginError: (url: string, imageType: string) => {
47
+ type: string;
48
+ action: string;
49
+ target: string;
50
+ agentName: string;
51
+ url: string;
52
+ };
53
+ export declare const getTextError: (url: string) => {
54
+ type: string;
55
+ action: string;
56
+ target: string;
57
+ agentName: string;
58
+ url: string;
59
+ };
60
+ export declare const imageReferenceUnknownMediaError: (key: string) => {
61
+ type: string;
62
+ action: string;
63
+ key: string;
64
+ };
65
+ export declare const imagePluginUnknownMediaError: (imageType: string) => {
66
+ type: string;
67
+ action: string;
68
+ target: string;
69
+ };
@@ -0,0 +1,97 @@
1
+ const urlFileNotFoundType = "urlFileNotFound";
2
+ const fileNotExistType = "fileNotExist";
3
+ const unknownMediaType = "unknownMedia";
4
+ const sourceUndefinedType = "undefinedSourceType";
5
+ const movieAction = "movie";
6
+ const imageAction = "images";
7
+ const aucioAction = "audio";
8
+ const imageReferenceAction = "imageReference";
9
+ export const getAudioInputIdsError = (index, fileName) => {
10
+ return {
11
+ type: fileNotExistType,
12
+ action: movieAction,
13
+ target: "audioFile",
14
+ agentName: "combineAudioFiles",
15
+ beatIndex: index,
16
+ fileName,
17
+ };
18
+ };
19
+ export const audioCheckerError = (index, fileName) => {
20
+ return {
21
+ type: fileNotExistType,
22
+ action: imageAction,
23
+ target: "imageFile",
24
+ agentName: "audioChecker",
25
+ beatIndex: index,
26
+ fileName,
27
+ };
28
+ };
29
+ export const createVideoSourceError = (index) => {
30
+ return {
31
+ type: sourceUndefinedType,
32
+ action: movieAction,
33
+ agentName: "createVideo",
34
+ beatIndex: index,
35
+ };
36
+ };
37
+ export const invalidAudioSourceError = (beatIndex) => {
38
+ return {
39
+ type: sourceUndefinedType,
40
+ action: aucioAction,
41
+ target: "audioSource",
42
+ agentName: "getAudioPathOrUrl",
43
+ beatIndex,
44
+ };
45
+ };
46
+ export const createVideoFileError = (index, fileName) => {
47
+ return {
48
+ type: fileNotExistType,
49
+ action: movieAction,
50
+ target: "imageFile",
51
+ agentName: "createVideo",
52
+ beatIndex: index,
53
+ fileName,
54
+ };
55
+ };
56
+ export const downLoadReferenceImageError = (key, url) => {
57
+ return {
58
+ type: urlFileNotFoundType,
59
+ action: imageReferenceAction,
60
+ target: "imageFile",
61
+ agentName: "downloadUrl",
62
+ key,
63
+ url,
64
+ };
65
+ };
66
+ export const downloadImagePluginError = (url, imageType) => {
67
+ return {
68
+ type: urlFileNotFoundType,
69
+ action: imageAction,
70
+ target: imageType,
71
+ agentName: "imagePlugin",
72
+ url,
73
+ };
74
+ };
75
+ export const getTextError = (url) => {
76
+ return {
77
+ type: urlFileNotFoundType,
78
+ action: imageAction,
79
+ target: "code",
80
+ agentName: "mermaid",
81
+ url,
82
+ };
83
+ };
84
+ export const imageReferenceUnknownMediaError = (key) => {
85
+ return {
86
+ type: unknownMediaType,
87
+ action: imageReferenceAction,
88
+ key,
89
+ };
90
+ };
91
+ export const imagePluginUnknownMediaError = (imageType) => {
92
+ return {
93
+ type: unknownMediaType,
94
+ action: imageAction,
95
+ target: imageType,
96
+ };
97
+ };
@@ -1,5 +1,6 @@
1
1
  import ffmpeg from "fluent-ffmpeg";
2
2
  import { GraphAILogger } from "graphai";
3
+ import { isFile } from "./file.js";
3
4
  import fs from "fs";
4
5
  export const setFfmpegPath = (ffmpegPath) => {
5
6
  ffmpeg.setFfmpegPath(ffmpegPath);
@@ -100,7 +101,7 @@ export const extractImageFromMovie = (movieFile, imagePath) => {
100
101
  };
101
102
  export const trimMusic = (inputFile, startTime, duration) => {
102
103
  return new Promise((resolve, reject) => {
103
- if (!inputFile.startsWith("http://") && !inputFile.startsWith("https://") && !fs.existsSync(inputFile)) {
104
+ if (!inputFile.startsWith("http://") && !inputFile.startsWith("https://") && !isFile(inputFile)) {
104
105
  reject(new Error(`File not found: ${inputFile}`));
105
106
  return;
106
107
  }
package/lib/utils/file.js CHANGED
@@ -17,7 +17,7 @@ export const updateNpmRoot = (_npmRoot) => {
17
17
  };
18
18
  export function readMulmoScriptFile(arg2, errorMessage) {
19
19
  const scriptPath = path.resolve(arg2);
20
- if (!fs.existsSync(scriptPath)) {
20
+ if (!isFile(scriptPath)) {
21
21
  if (errorMessage) {
22
22
  GraphAILogger.info(errorMessage);
23
23
  }
@@ -3,7 +3,7 @@ import fs from "fs";
3
3
  import path from "path";
4
4
  import fsPromise from "fs/promises";
5
5
  import { GraphAILogger } from "graphai";
6
- import { writingMessage } from "./file.js";
6
+ import { writingMessage, isFile } from "./file.js";
7
7
  import { text2hash } from "./utils_node.js";
8
8
  import { MulmoStudioContextMethods } from "../methods/mulmo_studio_context.js";
9
9
  import { replacementsJa, replacePairsJa } from "../utils/string.js";
@@ -64,7 +64,7 @@ export const browserlessCacheGenerator = (cacheDir) => {
64
64
  const browserlessCache = async (context, next) => {
65
65
  const cacheKey = text2hash(context?.namedInputs?.url);
66
66
  const cachePath = path.resolve(cacheDir, cacheKey + ".txt");
67
- if (fs.existsSync(cachePath)) {
67
+ if (isFile(cachePath)) {
68
68
  // console.log("cache hit!!");
69
69
  const text = fs.readFileSync(cachePath, "utf-8");
70
70
  return { text };
@@ -1,5 +1,3 @@
1
- import { ImageProcessorParams } from "../../types/index.js";
2
- type ImageType = "image" | "movie";
1
+ import { type ImageProcessorParams, type ImageType } from "../../types/index.js";
3
2
  export declare const processSource: (imageType: ImageType) => (params: ImageProcessorParams) => Promise<string | undefined>;
4
- export declare const pathSource: (__: ImageType) => (params: ImageProcessorParams) => string | undefined;
5
- export {};
3
+ export declare const pathSource: (imageType: ImageType) => (params: ImageProcessorParams) => string | undefined;
@@ -1,48 +1,19 @@
1
- import fs from "fs";
2
- import { GraphAILogger } from "graphai";
3
1
  import { MulmoMediaSourceMethods } from "../../methods/mulmo_media_source.js";
4
- function fixExtention(path, imageType) {
5
- if (imageType === "movie") {
6
- return path.replace(/\.png$/, ".mov");
7
- }
8
- return path;
9
- }
10
2
  export const processSource = (imageType) => {
11
3
  return async (params) => {
12
4
  const { beat, context } = params;
13
5
  if (!beat?.image || beat.image.type !== imageType)
14
6
  return;
15
- if (beat.image.source.kind === "url") {
16
- const response = await fetch(beat.image.source.url);
17
- if (!response.ok) {
18
- throw new Error(`Failed to download image: ${beat.image.source.url}`);
19
- }
20
- const buffer = Buffer.from(await response.arrayBuffer());
21
- // Detect file extension from Content-Type header or URL
22
- const imagePath = fixExtention(params.imagePath, beat.image.type);
23
- await fs.promises.writeFile(imagePath, buffer);
24
- return imagePath;
25
- }
26
- const path = MulmoMediaSourceMethods.resolve(beat.image.source, context);
27
- if (path) {
28
- return path;
29
- }
30
- GraphAILogger.error(`Image Plugin unknown ${imageType} source type:`, beat.image);
31
- throw new Error(`ERROR: unknown ${imageType} source type`);
7
+ return MulmoMediaSourceMethods.imagePluginSource(beat.image.source, context, params.imagePath, imageType);
32
8
  };
33
9
  };
34
- export const pathSource = (__) => {
10
+ export const pathSource = (imageType) => {
35
11
  return (params) => {
36
12
  const { beat, context } = params;
13
+ if (!beat?.image || beat.image.type !== imageType)
14
+ return;
37
15
  if (beat.image?.type == "image" || beat.image?.type == "movie") {
38
- if (beat.image.source?.kind === "url") {
39
- return fixExtention(params.imagePath, beat.image.type);
40
- }
41
- const path = MulmoMediaSourceMethods.resolve(beat.image.source, context);
42
- if (path) {
43
- return path;
44
- }
45
- return undefined;
16
+ return MulmoMediaSourceMethods.imagePluginSourcePath(beat.image.source, context, params.imagePath, imageType);
46
17
  }
47
18
  };
48
19
  };
@@ -17,7 +17,6 @@ export declare const localizedText: (beat: MulmoBeat, multiLingualData?: MulmoSt
17
17
  export declare function processLineBreaks(text: string): string;
18
18
  export declare function userAssert(condition: boolean, message: string): asserts condition;
19
19
  export declare const settings2GraphAIConfig: (settings?: Record<string, string>, env?: Record<string, string | undefined>) => ConfigDataDictionary<DefaultConfigData>;
20
- export declare const getExtention: (contentType: string | null, url: string) => string;
21
20
  type Primitive = string | number | boolean | symbol | bigint;
22
21
  type CleanableValue = Primitive | null | undefined | CleanableObject | CleanableValue[];
23
22
  type CleanableObject = {
@@ -90,20 +90,6 @@ export const settings2GraphAIConfig = (settings, env) => {
90
90
  };
91
91
  return deepClean(config) ?? {};
92
92
  };
93
- export const getExtention = (contentType, url) => {
94
- if (contentType?.includes("jpeg") || contentType?.includes("jpg")) {
95
- return "jpg";
96
- }
97
- else if (contentType?.includes("png")) {
98
- return "png";
99
- }
100
- // Fall back to URL extension
101
- const urlExtension = url.split(".").pop()?.toLowerCase();
102
- if (urlExtension && ["jpg", "jpeg", "png"].includes(urlExtension)) {
103
- return urlExtension === "jpeg" ? "jpg" : urlExtension;
104
- }
105
- return "png"; // default
106
- };
107
93
  export const deepClean = (input) => {
108
94
  if (input === null || input === undefined || input === "") {
109
95
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "1.2.43",
3
+ "version": "1.2.44",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",
@@ -82,18 +82,18 @@
82
82
  "@graphai/vanilla_node_agents": "^2.0.4",
83
83
  "@inquirer/input": "^4.2.4",
84
84
  "@inquirer/select": "^4.3.4",
85
- "@modelcontextprotocol/sdk": "^1.18.2",
85
+ "@modelcontextprotocol/sdk": "^1.19.1",
86
86
  "@mozilla/readability": "^0.6.0",
87
87
  "@tavily/core": "^0.5.11",
88
88
  "clipboardy": "^4.0.0",
89
- "dotenv": "^17.2.2",
89
+ "dotenv": "^17.2.3",
90
90
  "fluent-ffmpeg": "^2.1.3",
91
- "graphai": "^2.0.15",
91
+ "graphai": "^2.0.16",
92
92
  "jsdom": "^27.0.0",
93
93
  "marked": "^16.3.0",
94
94
  "mulmocast-vision": "^1.0.4",
95
95
  "ora": "^8.2.0",
96
- "puppeteer": "^24.20.0",
96
+ "puppeteer": "^24.23.0",
97
97
  "replicate": "^1.1.0",
98
98
  "yaml": "^2.8.1",
99
99
  "yargs": "^18.0.0",
@@ -103,16 +103,16 @@
103
103
  "devDependencies": {
104
104
  "@receptron/test_utils": "^2.0.3",
105
105
  "@types/fluent-ffmpeg": "^2.1.26",
106
- "@types/jsdom": "^21.1.7",
106
+ "@types/jsdom": "^27.0.0",
107
107
  "@types/yargs": "^17.0.33",
108
- "eslint": "^9.36.0",
108
+ "eslint": "^9.37.0",
109
109
  "eslint-config-prettier": "^10.1.8",
110
110
  "eslint-plugin-prettier": "^5.5.4",
111
111
  "eslint-plugin-sonarjs": "^3.0.5",
112
112
  "prettier": "^3.6.2",
113
113
  "tsx": "^4.20.6",
114
- "typescript": "^5.9.2",
115
- "typescript-eslint": "^8.44.1"
114
+ "typescript": "^5.9.3",
115
+ "typescript-eslint": "^8.45.0"
116
116
  },
117
117
  "engines": {
118
118
  "node": ">=20.0.0"