mulmocast 1.2.6 → 1.2.7
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/agents/image_openai_agent.js +1 -1
- package/lib/utils/context.js +1 -0
- package/package.json +1 -1
- package/lib/index.d.ts +0 -8
- package/lib/index.js +0 -9
- package/lib/methods/mulmo_script_template.d.ts +0 -4
- package/lib/methods/mulmo_script_template.js +0 -6
- package/lib/utils/assets.d.ts +0 -18
- package/lib/utils/assets.js +0 -101
- package/lib/utils/preprocess.d.ts +0 -343
- package/lib/utils/preprocess.js +0 -58
- package/lib/utils/system_prompt.d.ts +0 -1
- package/lib/utils/system_prompt.js +0 -1
- package/lib/utils/templates.d.ts +0 -3
- package/lib/utils/templates.js +0 -46
|
@@ -42,10 +42,10 @@ export const imageOpenaiAgent = async ({ namedInputs, params, config, }) => {
|
|
|
42
42
|
prompt,
|
|
43
43
|
n: 1,
|
|
44
44
|
size,
|
|
45
|
-
background: "opaque",
|
|
46
45
|
};
|
|
47
46
|
if (model === "gpt-image-1") {
|
|
48
47
|
imageOptions.moderation = moderation || "auto";
|
|
48
|
+
imageOptions.background = "opaque";
|
|
49
49
|
if (quality) {
|
|
50
50
|
imageOptions.quality = quality;
|
|
51
51
|
}
|
package/lib/utils/context.js
CHANGED
|
@@ -5,6 +5,7 @@ import { mulmoStudioSchema, mulmoCaptionParamsSchema, mulmoPresentationStyleSche
|
|
|
5
5
|
import { MulmoPresentationStyleMethods, MulmoScriptMethods, MulmoStudioMultiLingualMethod } from "../methods/index.js";
|
|
6
6
|
const mulmoCredit = (speaker) => {
|
|
7
7
|
return {
|
|
8
|
+
id: "mulmo_credit",
|
|
8
9
|
speaker,
|
|
9
10
|
text: "",
|
|
10
11
|
image: {
|
package/package.json
CHANGED
package/lib/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./actions/index.js";
|
|
2
|
-
export * from "./cli/helpers.js";
|
|
3
|
-
export * from "./utils/file.js";
|
|
4
|
-
export * from "./utils/ffmpeg_utils.js";
|
|
5
|
-
export * from "./utils/provider2agent.js";
|
|
6
|
-
export * from "./methods/index.js";
|
|
7
|
-
export * from "./agents/index.js";
|
|
8
|
-
export * from "./types/index.js";
|
package/lib/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// NOTE: If you want to support usage in the browser codebase, also add to src/index.browser.ts
|
|
2
|
-
export * from "./actions/index.js";
|
|
3
|
-
export * from "./cli/helpers.js";
|
|
4
|
-
export * from "./utils/file.js";
|
|
5
|
-
export * from "./utils/ffmpeg_utils.js";
|
|
6
|
-
export * from "./utils/provider2agent.js";
|
|
7
|
-
export * from "./methods/index.js";
|
|
8
|
-
export * from "./agents/index.js";
|
|
9
|
-
export * from "./types/index.js";
|
package/lib/utils/assets.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type BgmAsset = {
|
|
2
|
-
name: string;
|
|
3
|
-
title: string;
|
|
4
|
-
url: string;
|
|
5
|
-
suno_url: string;
|
|
6
|
-
date: string;
|
|
7
|
-
duration: string;
|
|
8
|
-
account: string;
|
|
9
|
-
original_license: string;
|
|
10
|
-
prompt: string;
|
|
11
|
-
model: string;
|
|
12
|
-
};
|
|
13
|
-
export type BgmAssets = {
|
|
14
|
-
license: string;
|
|
15
|
-
bgms: BgmAsset[];
|
|
16
|
-
};
|
|
17
|
-
export declare const bgmAssets: BgmAssets;
|
|
18
|
-
export {};
|
package/lib/utils/assets.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export const bgmAssets = {
|
|
2
|
-
license: "Free to distribute as the BMG of media generated by MulmoCast, including commercial use.",
|
|
3
|
-
bgms: [
|
|
4
|
-
{
|
|
5
|
-
name: "story001.mp3",
|
|
6
|
-
title: "Whispered Melody",
|
|
7
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story001.mp3",
|
|
8
|
-
suno_url: "https://suno.com/s/v6zer50aQJu8Y0qA",
|
|
9
|
-
date: "2025-06-17",
|
|
10
|
-
duration: "03:17",
|
|
11
|
-
account: "@snakajima",
|
|
12
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
13
|
-
prompt: "instrumental, smooth, piano",
|
|
14
|
-
model: "v4.5 beta",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "story002.mp3",
|
|
18
|
-
title: "Rise and Shine",
|
|
19
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story002.mp3",
|
|
20
|
-
suno_url: "https://suno.com/s/mJnvyu3UXnkdAPfQ",
|
|
21
|
-
date: "2025-06-17",
|
|
22
|
-
duration: "04:04",
|
|
23
|
-
account: "@snakajima",
|
|
24
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
25
|
-
prompt: "techno, inspiring, piano",
|
|
26
|
-
model: "v4.5 beta",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "story003.mp3",
|
|
30
|
-
title: "Chasing the Sunset",
|
|
31
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story003.mp3",
|
|
32
|
-
suno_url: "https://suno.com/s/2zGjMQ9vURJbaMZA",
|
|
33
|
-
date: "2025-06-17",
|
|
34
|
-
duration: "02:49",
|
|
35
|
-
account: "@snakajima",
|
|
36
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
37
|
-
prompt: "piano, inspiring, sunset",
|
|
38
|
-
model: "v4.5 beta",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "story004.mp3",
|
|
42
|
-
title: "Whispering Keys",
|
|
43
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story004.mp3",
|
|
44
|
-
suno_url: "https://suno.com/s/0SFoBRsBWsncw6tu",
|
|
45
|
-
date: "2025-06-17",
|
|
46
|
-
duration: "04:00",
|
|
47
|
-
account: "@snakajima",
|
|
48
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
49
|
-
prompt: "Piano, classical, ambient",
|
|
50
|
-
model: "v4",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "story005.mp3",
|
|
54
|
-
title: "Whisper of Ivory",
|
|
55
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/story005.mp3",
|
|
56
|
-
suno_url: "https://suno.com/s/0SFoBRsBWsncw6tu",
|
|
57
|
-
date: "2025-06-17",
|
|
58
|
-
duration: "04:00",
|
|
59
|
-
account: "@snakajima",
|
|
60
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
61
|
-
prompt: "Piano solo, classical, ambient",
|
|
62
|
-
model: "v4",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: "theme001.mp3",
|
|
66
|
-
title: "Rise of the Flame",
|
|
67
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/theme001.mp3",
|
|
68
|
-
suno_url: "https://suno.com/s/WhYOf8oJYhBgSKET",
|
|
69
|
-
date: "2025-06-20",
|
|
70
|
-
duration: "03:23",
|
|
71
|
-
account: "@snakajima",
|
|
72
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
73
|
-
prompt: "Olympic Theme, classical, emotional",
|
|
74
|
-
model: "v4",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "olympic001.mp3",
|
|
78
|
-
title: "Olympic-style Theme Music",
|
|
79
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/olympic001.mp3",
|
|
80
|
-
suno_url: "https://suno.com/s/32wpnmCrkFVvkTSQ",
|
|
81
|
-
date: "2025-07-17",
|
|
82
|
-
duration: "02:54",
|
|
83
|
-
account: "@snakajima",
|
|
84
|
-
original_license: "Generated by Suno with commercial use rights (PRO Plan)",
|
|
85
|
-
prompt: "Epic orchestral fanfare in the style of John Williams' Olympic Fanfare and Theme. Bright brass fanfare, soaring strings, powerful percussion, and heroic French horn melodies. Triumphant and majestic mood, suitable for an opening ceremony or national celebration. Emphasize dynamic builds, rich harmonies, and cinematic grandeur.",
|
|
86
|
-
model: "v4.5+",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "morning001.mp3",
|
|
90
|
-
title: "Morning Dance",
|
|
91
|
-
url: "https://github.com/receptron/mulmocast-media/raw/refs/heads/main/bgms/morning001.mp3",
|
|
92
|
-
suno_url: "https://suno.com/s/9MTkutZYqxeyBlwK",
|
|
93
|
-
date: "2025-07-17",
|
|
94
|
-
duration: "03:52",
|
|
95
|
-
account: "@snakajima",
|
|
96
|
-
original_license: "morning, piano solo, Japanese name, sexy",
|
|
97
|
-
prompt: "morning, piano solo, Japanese name, sexy",
|
|
98
|
-
model: "v4.5+",
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
};
|
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { MulmoStudio, MulmoScript, MulmoPresentationStyle } from "../types/index.js";
|
|
2
|
-
export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, currentStudio: MulmoStudio | undefined, fileName: string, videoCaptionLang?: string, presentationStyle?: MulmoPresentationStyle | null) => {
|
|
3
|
-
beats: {
|
|
4
|
-
duration?: number | undefined;
|
|
5
|
-
startAt?: number | undefined;
|
|
6
|
-
hash?: string | undefined;
|
|
7
|
-
audioDuration?: number | undefined;
|
|
8
|
-
movieDuration?: number | undefined;
|
|
9
|
-
silenceDuration?: number | undefined;
|
|
10
|
-
hasMovieAudio?: boolean | undefined;
|
|
11
|
-
audioFile?: string | undefined;
|
|
12
|
-
imageFile?: string | undefined;
|
|
13
|
-
movieFile?: string | undefined;
|
|
14
|
-
soundEffectFile?: string | undefined;
|
|
15
|
-
lipSyncFile?: string | undefined;
|
|
16
|
-
captionFile?: string | undefined;
|
|
17
|
-
}[];
|
|
18
|
-
script: {
|
|
19
|
-
lang: string;
|
|
20
|
-
imageParams: {
|
|
21
|
-
provider: string;
|
|
22
|
-
model?: string | undefined;
|
|
23
|
-
style?: string | undefined;
|
|
24
|
-
quality?: string | undefined;
|
|
25
|
-
moderation?: string | undefined;
|
|
26
|
-
images?: Record<string, {
|
|
27
|
-
type: "image";
|
|
28
|
-
source: {
|
|
29
|
-
url: string;
|
|
30
|
-
kind: "url";
|
|
31
|
-
} | {
|
|
32
|
-
kind: "base64";
|
|
33
|
-
data: string;
|
|
34
|
-
} | {
|
|
35
|
-
text: string;
|
|
36
|
-
kind: "text";
|
|
37
|
-
} | {
|
|
38
|
-
path: string;
|
|
39
|
-
kind: "path";
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
|
-
type: "imagePrompt";
|
|
43
|
-
prompt: string;
|
|
44
|
-
}> | undefined;
|
|
45
|
-
};
|
|
46
|
-
audioParams: {
|
|
47
|
-
padding: number;
|
|
48
|
-
introPadding: number;
|
|
49
|
-
closingPadding: number;
|
|
50
|
-
outroPadding: number;
|
|
51
|
-
bgmVolume: number;
|
|
52
|
-
audioVolume: number;
|
|
53
|
-
suppressSpeech: boolean;
|
|
54
|
-
bgm?: {
|
|
55
|
-
url: string;
|
|
56
|
-
kind: "url";
|
|
57
|
-
} | {
|
|
58
|
-
kind: "base64";
|
|
59
|
-
data: string;
|
|
60
|
-
} | {
|
|
61
|
-
text: string;
|
|
62
|
-
kind: "text";
|
|
63
|
-
} | {
|
|
64
|
-
path: string;
|
|
65
|
-
kind: "path";
|
|
66
|
-
} | undefined;
|
|
67
|
-
};
|
|
68
|
-
movieParams: {
|
|
69
|
-
provider?: string | undefined;
|
|
70
|
-
model?: string | undefined;
|
|
71
|
-
fillOption?: {
|
|
72
|
-
style: "aspectFit" | "aspectFill";
|
|
73
|
-
} | undefined;
|
|
74
|
-
transition?: {
|
|
75
|
-
type: "fade" | "slideout_left";
|
|
76
|
-
duration: number;
|
|
77
|
-
} | undefined;
|
|
78
|
-
};
|
|
79
|
-
soundEffectParams: {
|
|
80
|
-
provider?: string | undefined;
|
|
81
|
-
model?: string | undefined;
|
|
82
|
-
};
|
|
83
|
-
$mulmocast: {
|
|
84
|
-
version: "1.1";
|
|
85
|
-
credit?: "closing" | undefined;
|
|
86
|
-
};
|
|
87
|
-
canvasSize: {
|
|
88
|
-
width: number;
|
|
89
|
-
height: number;
|
|
90
|
-
};
|
|
91
|
-
speechParams: {
|
|
92
|
-
speakers: Record<string, {
|
|
93
|
-
voiceId: string;
|
|
94
|
-
lang?: Record<string, {
|
|
95
|
-
voiceId: string;
|
|
96
|
-
displayName?: Record<string, string> | undefined;
|
|
97
|
-
isDefault?: boolean | undefined;
|
|
98
|
-
speechOptions?: {
|
|
99
|
-
speed?: number | undefined;
|
|
100
|
-
instruction?: string | undefined;
|
|
101
|
-
} | undefined;
|
|
102
|
-
provider?: string | undefined;
|
|
103
|
-
model?: string | undefined;
|
|
104
|
-
}> | undefined;
|
|
105
|
-
displayName?: Record<string, string> | undefined;
|
|
106
|
-
isDefault?: boolean | undefined;
|
|
107
|
-
speechOptions?: {
|
|
108
|
-
speed?: number | undefined;
|
|
109
|
-
instruction?: string | undefined;
|
|
110
|
-
} | undefined;
|
|
111
|
-
provider?: string | undefined;
|
|
112
|
-
model?: string | undefined;
|
|
113
|
-
}>;
|
|
114
|
-
};
|
|
115
|
-
beats: {
|
|
116
|
-
text: string;
|
|
117
|
-
image?: {
|
|
118
|
-
type: "markdown";
|
|
119
|
-
markdown: string | string[];
|
|
120
|
-
} | {
|
|
121
|
-
type: "web";
|
|
122
|
-
url: string;
|
|
123
|
-
} | {
|
|
124
|
-
type: "pdf";
|
|
125
|
-
source: {
|
|
126
|
-
url: string;
|
|
127
|
-
kind: "url";
|
|
128
|
-
} | {
|
|
129
|
-
kind: "base64";
|
|
130
|
-
data: string;
|
|
131
|
-
} | {
|
|
132
|
-
text: string;
|
|
133
|
-
kind: "text";
|
|
134
|
-
} | {
|
|
135
|
-
path: string;
|
|
136
|
-
kind: "path";
|
|
137
|
-
};
|
|
138
|
-
} | {
|
|
139
|
-
type: "image";
|
|
140
|
-
source: {
|
|
141
|
-
url: string;
|
|
142
|
-
kind: "url";
|
|
143
|
-
} | {
|
|
144
|
-
kind: "base64";
|
|
145
|
-
data: string;
|
|
146
|
-
} | {
|
|
147
|
-
text: string;
|
|
148
|
-
kind: "text";
|
|
149
|
-
} | {
|
|
150
|
-
path: string;
|
|
151
|
-
kind: "path";
|
|
152
|
-
};
|
|
153
|
-
} | {
|
|
154
|
-
type: "svg";
|
|
155
|
-
source: {
|
|
156
|
-
url: string;
|
|
157
|
-
kind: "url";
|
|
158
|
-
} | {
|
|
159
|
-
kind: "base64";
|
|
160
|
-
data: string;
|
|
161
|
-
} | {
|
|
162
|
-
text: string;
|
|
163
|
-
kind: "text";
|
|
164
|
-
} | {
|
|
165
|
-
path: string;
|
|
166
|
-
kind: "path";
|
|
167
|
-
};
|
|
168
|
-
} | {
|
|
169
|
-
type: "movie";
|
|
170
|
-
source: {
|
|
171
|
-
url: string;
|
|
172
|
-
kind: "url";
|
|
173
|
-
} | {
|
|
174
|
-
kind: "base64";
|
|
175
|
-
data: string;
|
|
176
|
-
} | {
|
|
177
|
-
text: string;
|
|
178
|
-
kind: "text";
|
|
179
|
-
} | {
|
|
180
|
-
path: string;
|
|
181
|
-
kind: "path";
|
|
182
|
-
};
|
|
183
|
-
} | {
|
|
184
|
-
type: "textSlide";
|
|
185
|
-
slide: {
|
|
186
|
-
title: string;
|
|
187
|
-
subtitle?: string | undefined;
|
|
188
|
-
bullets?: string[] | undefined;
|
|
189
|
-
};
|
|
190
|
-
} | {
|
|
191
|
-
type: "chart";
|
|
192
|
-
title: string;
|
|
193
|
-
chartData: Record<string, any>;
|
|
194
|
-
} | {
|
|
195
|
-
code: {
|
|
196
|
-
url: string;
|
|
197
|
-
kind: "url";
|
|
198
|
-
} | {
|
|
199
|
-
kind: "base64";
|
|
200
|
-
data: string;
|
|
201
|
-
} | {
|
|
202
|
-
text: string;
|
|
203
|
-
kind: "text";
|
|
204
|
-
} | {
|
|
205
|
-
path: string;
|
|
206
|
-
kind: "path";
|
|
207
|
-
};
|
|
208
|
-
type: "mermaid";
|
|
209
|
-
title: string;
|
|
210
|
-
appendix?: string[] | undefined;
|
|
211
|
-
} | {
|
|
212
|
-
type: "html_tailwind";
|
|
213
|
-
html: string | string[];
|
|
214
|
-
} | {
|
|
215
|
-
type: "beat";
|
|
216
|
-
id?: string | undefined;
|
|
217
|
-
} | {
|
|
218
|
-
type: "voice_over";
|
|
219
|
-
startAt?: number | undefined;
|
|
220
|
-
} | undefined;
|
|
221
|
-
audio?: {
|
|
222
|
-
type: "audio";
|
|
223
|
-
source: {
|
|
224
|
-
url: string;
|
|
225
|
-
kind: "url";
|
|
226
|
-
} | {
|
|
227
|
-
kind: "base64";
|
|
228
|
-
data: string;
|
|
229
|
-
} | {
|
|
230
|
-
text: string;
|
|
231
|
-
kind: "text";
|
|
232
|
-
} | {
|
|
233
|
-
path: string;
|
|
234
|
-
kind: "path";
|
|
235
|
-
};
|
|
236
|
-
} | {
|
|
237
|
-
type: "midi";
|
|
238
|
-
source: string;
|
|
239
|
-
} | undefined;
|
|
240
|
-
duration?: number | undefined;
|
|
241
|
-
speechOptions?: {
|
|
242
|
-
speed?: number | undefined;
|
|
243
|
-
instruction?: string | undefined;
|
|
244
|
-
} | undefined;
|
|
245
|
-
id?: string | undefined;
|
|
246
|
-
imagePrompt?: string | undefined;
|
|
247
|
-
speaker?: string | undefined;
|
|
248
|
-
description?: string | undefined;
|
|
249
|
-
imageParams?: {
|
|
250
|
-
provider: string;
|
|
251
|
-
model?: string | undefined;
|
|
252
|
-
style?: string | undefined;
|
|
253
|
-
quality?: string | undefined;
|
|
254
|
-
moderation?: string | undefined;
|
|
255
|
-
images?: Record<string, {
|
|
256
|
-
type: "image";
|
|
257
|
-
source: {
|
|
258
|
-
url: string;
|
|
259
|
-
kind: "url";
|
|
260
|
-
} | {
|
|
261
|
-
kind: "base64";
|
|
262
|
-
data: string;
|
|
263
|
-
} | {
|
|
264
|
-
text: string;
|
|
265
|
-
kind: "text";
|
|
266
|
-
} | {
|
|
267
|
-
path: string;
|
|
268
|
-
kind: "path";
|
|
269
|
-
};
|
|
270
|
-
} | {
|
|
271
|
-
type: "imagePrompt";
|
|
272
|
-
prompt: string;
|
|
273
|
-
}> | undefined;
|
|
274
|
-
} | undefined;
|
|
275
|
-
audioParams?: {
|
|
276
|
-
movieVolume: number;
|
|
277
|
-
padding?: number | undefined;
|
|
278
|
-
} | undefined;
|
|
279
|
-
movieParams?: {
|
|
280
|
-
speed?: number | undefined;
|
|
281
|
-
provider?: string | undefined;
|
|
282
|
-
model?: string | undefined;
|
|
283
|
-
fillOption?: {
|
|
284
|
-
style: "aspectFit" | "aspectFill";
|
|
285
|
-
} | undefined;
|
|
286
|
-
} | undefined;
|
|
287
|
-
soundEffectParams?: {
|
|
288
|
-
provider?: string | undefined;
|
|
289
|
-
model?: string | undefined;
|
|
290
|
-
} | undefined;
|
|
291
|
-
lipSyncParams?: {
|
|
292
|
-
provider?: string | undefined;
|
|
293
|
-
model?: string | undefined;
|
|
294
|
-
} | undefined;
|
|
295
|
-
htmlImageParams?: {
|
|
296
|
-
model?: string | undefined;
|
|
297
|
-
} | undefined;
|
|
298
|
-
textSlideParams?: {
|
|
299
|
-
cssStyles: string | string[];
|
|
300
|
-
} | undefined;
|
|
301
|
-
captionParams?: {
|
|
302
|
-
styles: string[];
|
|
303
|
-
lang?: string | undefined;
|
|
304
|
-
} | undefined;
|
|
305
|
-
imageNames?: string[] | undefined;
|
|
306
|
-
moviePrompt?: string | undefined;
|
|
307
|
-
soundEffectPrompt?: string | undefined;
|
|
308
|
-
htmlPrompt?: {
|
|
309
|
-
prompt: string;
|
|
310
|
-
data?: any;
|
|
311
|
-
images?: Record<string, any> | undefined;
|
|
312
|
-
systemPrompt?: string | undefined;
|
|
313
|
-
} | undefined;
|
|
314
|
-
enableLipSync?: boolean | undefined;
|
|
315
|
-
}[];
|
|
316
|
-
title?: string | undefined;
|
|
317
|
-
description?: string | undefined;
|
|
318
|
-
lipSyncParams?: {
|
|
319
|
-
provider?: string | undefined;
|
|
320
|
-
model?: string | undefined;
|
|
321
|
-
} | undefined;
|
|
322
|
-
htmlImageParams?: {
|
|
323
|
-
provider: string;
|
|
324
|
-
model?: string | undefined;
|
|
325
|
-
} | undefined;
|
|
326
|
-
textSlideParams?: {
|
|
327
|
-
cssStyles: string | string[];
|
|
328
|
-
} | undefined;
|
|
329
|
-
captionParams?: {
|
|
330
|
-
styles: string[];
|
|
331
|
-
lang?: string | undefined;
|
|
332
|
-
} | undefined;
|
|
333
|
-
references?: {
|
|
334
|
-
type: string;
|
|
335
|
-
url: string;
|
|
336
|
-
title?: string | undefined;
|
|
337
|
-
description?: string | undefined;
|
|
338
|
-
}[] | undefined;
|
|
339
|
-
imagePath?: string | undefined;
|
|
340
|
-
__test_invalid__?: boolean | undefined;
|
|
341
|
-
};
|
|
342
|
-
filename: string;
|
|
343
|
-
};
|
package/lib/utils/preprocess.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { GraphAILogger } from "graphai";
|
|
2
|
-
import { mulmoStudioSchema, mulmoCaptionParamsSchema } from "../types/index.js";
|
|
3
|
-
import { MulmoPresentationStyleMethods, MulmoScriptMethods } from "../methods/index.js";
|
|
4
|
-
const rebuildStudio = (currentStudio, mulmoScript, fileName) => {
|
|
5
|
-
const isTest = process.env.NODE_ENV === "test";
|
|
6
|
-
const parsed = isTest && currentStudio ? { data: mulmoStudioSchema.parse(currentStudio), success: true, error: null } : mulmoStudioSchema.safeParse(currentStudio);
|
|
7
|
-
if (parsed.success) {
|
|
8
|
-
return parsed.data;
|
|
9
|
-
}
|
|
10
|
-
if (currentStudio) {
|
|
11
|
-
GraphAILogger.info("currentStudio is invalid", parsed.error);
|
|
12
|
-
}
|
|
13
|
-
// We need to parse it to fill default values
|
|
14
|
-
return mulmoStudioSchema.parse({
|
|
15
|
-
script: mulmoScript,
|
|
16
|
-
filename: fileName,
|
|
17
|
-
beats: [...Array(mulmoScript.beats.length)].map(() => ({})),
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const mulmoCredit = (speaker) => {
|
|
21
|
-
return {
|
|
22
|
-
speaker,
|
|
23
|
-
text: "",
|
|
24
|
-
image: {
|
|
25
|
-
type: "image",
|
|
26
|
-
source: {
|
|
27
|
-
kind: "url",
|
|
28
|
-
url: "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/images/mulmocast_credit.png",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
audio: {
|
|
32
|
-
type: "audio",
|
|
33
|
-
source: {
|
|
34
|
-
kind: "url",
|
|
35
|
-
url: "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/audio/silent300.mp3",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export const createOrUpdateStudioData = (_mulmoScript, currentStudio, fileName, videoCaptionLang, presentationStyle) => {
|
|
41
|
-
const mulmoScript = _mulmoScript.__test_invalid__ ? _mulmoScript : MulmoScriptMethods.validate(_mulmoScript); // validate and insert default value
|
|
42
|
-
const studio = rebuildStudio(currentStudio, mulmoScript, fileName);
|
|
43
|
-
// TODO: Move this code out of this function later
|
|
44
|
-
// Addition cloing credit
|
|
45
|
-
if (mulmoScript.$mulmocast.credit === "closing") {
|
|
46
|
-
const defaultSpeaker = MulmoPresentationStyleMethods.getDefaultSpeaker(presentationStyle ?? studio.script);
|
|
47
|
-
mulmoScript.beats.push(mulmoCredit(mulmoScript.beats[0].speaker ?? defaultSpeaker)); // First speaker
|
|
48
|
-
}
|
|
49
|
-
studio.script = MulmoScriptMethods.validate(mulmoScript); // update the script
|
|
50
|
-
studio.beats = studio.script.beats.map((_, index) => studio.beats[index] ?? {});
|
|
51
|
-
if (videoCaptionLang) {
|
|
52
|
-
studio.script.captionParams = mulmoCaptionParamsSchema.parse({
|
|
53
|
-
...(studio.script.captionParams ?? {}),
|
|
54
|
-
lang: videoCaptionLang,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return studio;
|
|
58
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/utils/templates.d.ts
DELETED
package/lib/utils/templates.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { mulmoScriptSchema } from "../types/schema.js";
|
|
2
|
-
import { promptTemplates, scriptTemplates } from "../data/index.js";
|
|
3
|
-
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
4
|
-
// script and prompt template
|
|
5
|
-
export const readScriptTemplateFile = (scriptTemplateFileName) => {
|
|
6
|
-
// NOTE: We don't want to schema parse the script here to eliminate default values.
|
|
7
|
-
const scriptTemplate = scriptTemplates.find((template) => template.filename === scriptTemplateFileName);
|
|
8
|
-
if (!scriptTemplate) {
|
|
9
|
-
throw new Error(`Script template not found: ${scriptTemplateFileName}`);
|
|
10
|
-
}
|
|
11
|
-
const { filename: __, ...retValue } = scriptTemplate;
|
|
12
|
-
return retValue;
|
|
13
|
-
};
|
|
14
|
-
const readPromptTemplateFile = (promptTemplateFileName) => {
|
|
15
|
-
// NOTE: We don't want to schema parse the template here to eliminate default values.
|
|
16
|
-
const promptTemplate = promptTemplates.find((template) => template.filename === promptTemplateFileName);
|
|
17
|
-
if (!promptTemplate) {
|
|
18
|
-
throw new Error(`Prompt template not found: ${promptTemplateFileName}`);
|
|
19
|
-
}
|
|
20
|
-
return promptTemplate;
|
|
21
|
-
};
|
|
22
|
-
const mulmoScriptTemplate2Script = (scriptTemplate) => {
|
|
23
|
-
if (scriptTemplate.scriptName) {
|
|
24
|
-
const scriptTemplateData = readScriptTemplateFile(scriptTemplate.scriptName);
|
|
25
|
-
return { ...scriptTemplateData, ...(scriptTemplate.presentationStyle ?? {}) };
|
|
26
|
-
}
|
|
27
|
-
return undefined;
|
|
28
|
-
};
|
|
29
|
-
export const readTemplatePrompt = (promptTemplateFileName) => {
|
|
30
|
-
const promptTemplate = readPromptTemplateFile(promptTemplateFileName);
|
|
31
|
-
const script = mulmoScriptTemplate2Script(promptTemplate);
|
|
32
|
-
const prompt = getMulmoScriptTemplateSystemPrompt(promptTemplate, script);
|
|
33
|
-
return prompt;
|
|
34
|
-
};
|
|
35
|
-
const getMulmoScriptTemplateSystemPrompt = (template, script) => {
|
|
36
|
-
// script is provided, use it as a script template
|
|
37
|
-
if (script) {
|
|
38
|
-
return `${template.systemPrompt}\n\`\`\`JSON\n${JSON.stringify(script)}\n\`\`\``;
|
|
39
|
-
}
|
|
40
|
-
// script is not provided, use the default schema
|
|
41
|
-
const defaultSchema = zodToJsonSchema(mulmoScriptSchema, {
|
|
42
|
-
strictUnions: true,
|
|
43
|
-
});
|
|
44
|
-
const specificOutputPrompt = `The output should follow the JSON schema specified below. Please provide your response as valid JSON within \`\`\`json code blocks for clarity.`;
|
|
45
|
-
return `${template.systemPrompt}\n\n${specificOutputPrompt}\n\n\`\`\`JSON\n${JSON.stringify(defaultSchema)}\n\`\`\``;
|
|
46
|
-
};
|