mulmocast 2.1.8 → 2.1.9
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.
- package/lib/actions/bundle.js +11 -4
- package/lib/utils/context.d.ts +1 -0
- package/lib/utils/context.js +2 -1
- package/package.json +5 -5
package/lib/actions/bundle.js
CHANGED
|
@@ -6,6 +6,7 @@ import { mkdir } from "../utils/file.js";
|
|
|
6
6
|
import { ZipBuilder } from "../utils/zip.js";
|
|
7
7
|
import { bundleTargetLang } from "../utils/const.js";
|
|
8
8
|
import { createSilentAudio } from "../utils/ffmpeg_utils.js";
|
|
9
|
+
import { silentMp3 } from "../utils/context.js";
|
|
9
10
|
const downloadFile = async (url, destPath) => {
|
|
10
11
|
const response = await fetch(url);
|
|
11
12
|
if (!response.ok) {
|
|
@@ -53,7 +54,7 @@ const imageSourceMappings = [
|
|
|
53
54
|
];
|
|
54
55
|
export const mulmoViewerBundle = async (context) => {
|
|
55
56
|
const isZip = true;
|
|
56
|
-
const dir =
|
|
57
|
+
const dir = context.fileDirs.outDirPath;
|
|
57
58
|
mkdir(dir);
|
|
58
59
|
const zipper = new ZipBuilder(path.resolve(dir, zipFileName));
|
|
59
60
|
// text
|
|
@@ -67,18 +68,24 @@ export const mulmoViewerBundle = async (context) => {
|
|
|
67
68
|
// audio
|
|
68
69
|
for (const lang of bundleTargetLang) {
|
|
69
70
|
const audios = listLocalizedAudioPaths({ ...context, lang });
|
|
70
|
-
audios.
|
|
71
|
+
await Promise.all(audios.map(async (audio, index) => {
|
|
71
72
|
if (audio) {
|
|
72
73
|
const fileName = path.basename(audio ?? "");
|
|
73
74
|
if (resultJson[index] && resultJson[index].audioSources) {
|
|
74
75
|
resultJson[index].audioSources[lang] = fileName;
|
|
75
76
|
}
|
|
76
|
-
if (
|
|
77
|
+
if (fileName === "silent300.mp3") {
|
|
78
|
+
// Download from GitHub URL
|
|
79
|
+
const destPath = path.resolve(dir, fileName);
|
|
80
|
+
await downloadFile(silentMp3, destPath);
|
|
81
|
+
zipper.addFile(destPath, fileName);
|
|
82
|
+
}
|
|
83
|
+
else if (fs.existsSync(audio)) {
|
|
77
84
|
fs.copyFileSync(audio, path.resolve(dir, fileName));
|
|
78
85
|
zipper.addFile(audio, fileName);
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
|
-
});
|
|
88
|
+
}));
|
|
82
89
|
}
|
|
83
90
|
// image, movie
|
|
84
91
|
context.studio.beats.forEach((image, index) => {
|
package/lib/utils/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MulmoStudioBeat, MulmoScript, MulmoPresentationStyle, MulmoStudioMultiLingual, FileObject } from "../types/type.js";
|
|
2
|
+
export declare const silentMp3 = "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/audio/silent300.mp3";
|
|
2
3
|
export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: string, videoCaptionLang?: string, presentationStyle?: MulmoPresentationStyle | null) => {
|
|
3
4
|
script: {
|
|
4
5
|
$mulmocast: {
|
package/lib/utils/context.js
CHANGED
|
@@ -3,6 +3,7 @@ import { readMulmoScriptFile, fetchMulmoScriptFile, isFile } from "./file.js";
|
|
|
3
3
|
import { beatId, multiLingualObjectToArray } from "./utils.js";
|
|
4
4
|
import { mulmoStudioSchema, mulmoCaptionParamsSchema, mulmoPresentationStyleSchema } from "../types/schema.js";
|
|
5
5
|
import { MulmoPresentationStyleMethods, MulmoScriptMethods, MulmoStudioMultiLingualMethod } from "../methods/index.js";
|
|
6
|
+
export const silentMp3 = "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/audio/silent300.mp3";
|
|
6
7
|
const mulmoCredit = (speaker) => {
|
|
7
8
|
return {
|
|
8
9
|
id: "mulmo_credit",
|
|
@@ -19,7 +20,7 @@ const mulmoCredit = (speaker) => {
|
|
|
19
20
|
type: "audio",
|
|
20
21
|
source: {
|
|
21
22
|
kind: "url",
|
|
22
|
-
url:
|
|
23
|
+
url: silentMp3,
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.node.js",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"homepage": "https://github.com/receptron/mulmocast-cli#readme",
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@google-cloud/text-to-speech": "^6.4.0",
|
|
77
|
-
"@google/genai": "^1.
|
|
77
|
+
"@google/genai": "^1.34.0",
|
|
78
78
|
"@graphai/anthropic_agent": "^2.0.12",
|
|
79
79
|
"@graphai/browserless_agent": "^2.0.1",
|
|
80
80
|
"@graphai/gemini_agent": "^2.0.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@graphai/vanilla_node_agents": "^2.0.4",
|
|
87
87
|
"@inquirer/input": "^4.3.0",
|
|
88
88
|
"@inquirer/select": "^4.4.1",
|
|
89
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
89
|
+
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
90
90
|
"@mozilla/readability": "^0.6.0",
|
|
91
91
|
"@tavily/core": "^0.5.11",
|
|
92
92
|
"archiver": "^7.0.1",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"replicate": "^1.4.0",
|
|
103
103
|
"yaml": "^2.8.2",
|
|
104
104
|
"yargs": "^18.0.0",
|
|
105
|
-
"zod": "^4.1
|
|
105
|
+
"zod": "^4.2.1"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@receptron/test_utils": "^2.0.3",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"prettier": "^3.7.4",
|
|
118
118
|
"tsx": "^4.21.0",
|
|
119
119
|
"typescript": "^5.9.3",
|
|
120
|
-
"typescript-eslint": "^8.
|
|
120
|
+
"typescript-eslint": "^8.50.0"
|
|
121
121
|
},
|
|
122
122
|
"engines": {
|
|
123
123
|
"node": ">=20.0.0"
|