mulmocast 2.0.6 → 2.0.8
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/audio.js +3 -1
- package/lib/agents/image_genai_agent.js +62 -56
- package/lib/agents/image_replicate_agent.js +9 -1
- package/lib/agents/index.d.ts +2 -1
- package/lib/agents/index.js +2 -1
- package/lib/agents/movie_genai_agent.d.ts +0 -4
- package/lib/agents/movie_genai_agent.js +3 -12
- package/lib/agents/test.d.ts +1 -0
- package/lib/agents/test.js +12 -0
- package/lib/agents/tts_elevenlabs_agent.js +42 -32
- package/lib/agents/tts_gemini_agent.js +8 -2
- package/lib/agents/tts_kotodama_agent.d.ts +5 -0
- package/lib/agents/tts_kotodama_agent.js +76 -0
- package/lib/agents/tts_openai_agent.js +1 -1
- package/lib/agents/utils.d.ts +1 -0
- package/lib/agents/utils.js +1 -0
- package/lib/types/agent.d.ts +3 -0
- package/lib/types/schema.d.ts +21 -0
- package/lib/types/schema.js +3 -2
- package/lib/utils/const.d.ts +1 -0
- package/lib/utils/const.js +1 -0
- package/lib/utils/context.d.ts +8 -0
- package/lib/utils/error_cause.d.ts +10 -0
- package/lib/utils/error_cause.js +22 -0
- package/lib/utils/provider2agent.d.ts +7 -0
- package/lib/utils/provider2agent.js +7 -0
- package/lib/utils/utils.d.ts +4 -0
- package/lib/utils/utils.js +21 -6
- package/package.json +4 -4
- package/scripts/test/README.md +161 -0
- package/scripts/test/test_all_elevenlabs_tts_model.json +111 -0
- package/scripts/test/test_all_gemini_tts_model.json +433 -0
- package/scripts/test/test_all_image.json +40 -0
- package/scripts/test/test_all_image.json~ +45 -0
- package/scripts/test/test_all_movie.json +33 -0
- package/scripts/test/test_all_movie.json~ +37 -0
- package/scripts/test/test_all_tts.json +83 -0
- package/scripts/test/test_all_tts.json~ +83 -0
- package/scripts/test/test_kotodama.json +57 -0
- package/scripts/test/test_kotodama.json~ +0 -0
package/lib/types/schema.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare const multiLingualTextsSchema: z.ZodRecord<z.ZodString, z.ZodObje
|
|
|
19
19
|
export declare const speechOptionsSchema: z.ZodObject<{
|
|
20
20
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
21
21
|
instruction: z.ZodOptional<z.ZodString>;
|
|
22
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
22
23
|
}, z.core.$strict>;
|
|
23
24
|
export declare const defaultSpeaker = "Presenter";
|
|
24
25
|
export declare const text2SpeechProviderSchema: z.ZodDefault<z.ZodEnum<{
|
|
@@ -31,6 +32,7 @@ export declare const speakerDataSchema: z.ZodObject<{
|
|
|
31
32
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
32
33
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
33
34
|
instruction: z.ZodOptional<z.ZodString>;
|
|
35
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
34
36
|
}, z.core.$strict>>;
|
|
35
37
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
36
38
|
[x: string]: string;
|
|
@@ -44,6 +46,7 @@ export declare const speakerSchema: z.ZodObject<{
|
|
|
44
46
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
45
47
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
46
48
|
instruction: z.ZodOptional<z.ZodString>;
|
|
49
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
47
50
|
}, z.core.$strict>>;
|
|
48
51
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
49
52
|
[x: string]: string;
|
|
@@ -56,6 +59,7 @@ export declare const speakerSchema: z.ZodObject<{
|
|
|
56
59
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
57
60
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
58
61
|
instruction: z.ZodOptional<z.ZodString>;
|
|
62
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
59
63
|
}, z.core.$strict>>;
|
|
60
64
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
61
65
|
[x: string]: string;
|
|
@@ -70,6 +74,7 @@ export declare const speakerDictionarySchema: z.ZodRecord<z.ZodString, z.ZodObje
|
|
|
70
74
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
71
75
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
72
76
|
instruction: z.ZodOptional<z.ZodString>;
|
|
77
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
73
78
|
}, z.core.$strict>>;
|
|
74
79
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
75
80
|
[x: string]: string;
|
|
@@ -82,6 +87,7 @@ export declare const speakerDictionarySchema: z.ZodRecord<z.ZodString, z.ZodObje
|
|
|
82
87
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
83
88
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
84
89
|
instruction: z.ZodOptional<z.ZodString>;
|
|
90
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
85
91
|
}, z.core.$strict>>;
|
|
86
92
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
87
93
|
[x: string]: string;
|
|
@@ -97,6 +103,7 @@ export declare const mulmoSpeechParamsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
97
103
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
98
104
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
99
105
|
instruction: z.ZodOptional<z.ZodString>;
|
|
106
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
100
107
|
}, z.core.$strict>>;
|
|
101
108
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
102
109
|
[x: string]: string;
|
|
@@ -109,6 +116,7 @@ export declare const mulmoSpeechParamsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
109
116
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
110
117
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
111
118
|
instruction: z.ZodOptional<z.ZodString>;
|
|
119
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
112
120
|
}, z.core.$strict>>;
|
|
113
121
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
114
122
|
[x: string]: string;
|
|
@@ -629,6 +637,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
629
637
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
630
638
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
631
639
|
instruction: z.ZodOptional<z.ZodString>;
|
|
640
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
632
641
|
}, z.core.$strict>>;
|
|
633
642
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
634
643
|
cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
@@ -716,6 +725,7 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
716
725
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
717
726
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
718
727
|
instruction: z.ZodOptional<z.ZodString>;
|
|
728
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
719
729
|
}, z.core.$strict>>;
|
|
720
730
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
721
731
|
[x: string]: string;
|
|
@@ -728,6 +738,7 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
728
738
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
729
739
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
730
740
|
instruction: z.ZodOptional<z.ZodString>;
|
|
741
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
731
742
|
}, z.core.$strict>>;
|
|
732
743
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
733
744
|
[x: string]: string;
|
|
@@ -852,6 +863,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
852
863
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
853
864
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
854
865
|
instruction: z.ZodOptional<z.ZodString>;
|
|
866
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
855
867
|
}, z.core.$strict>>;
|
|
856
868
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
857
869
|
[x: string]: string;
|
|
@@ -864,6 +876,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
864
876
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
865
877
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
866
878
|
instruction: z.ZodOptional<z.ZodString>;
|
|
879
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
867
880
|
}, z.core.$strict>>;
|
|
868
881
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
869
882
|
[x: string]: string;
|
|
@@ -1133,6 +1146,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
1133
1146
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1134
1147
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1135
1148
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1149
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1136
1150
|
}, z.core.$strict>>;
|
|
1137
1151
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
1138
1152
|
cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
@@ -1264,6 +1278,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
1264
1278
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1265
1279
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1266
1280
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1281
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1267
1282
|
}, z.core.$strict>>;
|
|
1268
1283
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1269
1284
|
[x: string]: string;
|
|
@@ -1276,6 +1291,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
1276
1291
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1277
1292
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1278
1293
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1294
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1279
1295
|
}, z.core.$strict>>;
|
|
1280
1296
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1281
1297
|
[x: string]: string;
|
|
@@ -1545,6 +1561,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
1545
1561
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1546
1562
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1547
1563
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1564
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1548
1565
|
}, z.core.$strict>>;
|
|
1549
1566
|
textSlideParams: z.ZodOptional<z.ZodObject<{
|
|
1550
1567
|
cssStyles: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
@@ -1612,6 +1629,7 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
1612
1629
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1613
1630
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1614
1631
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1632
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1615
1633
|
}, z.core.$strict>>;
|
|
1616
1634
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1617
1635
|
[x: string]: string;
|
|
@@ -1624,6 +1642,7 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
1624
1642
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1625
1643
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1626
1644
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1645
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1627
1646
|
}, z.core.$strict>>;
|
|
1628
1647
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1629
1648
|
[x: string]: string;
|
|
@@ -1742,6 +1761,7 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
1742
1761
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1743
1762
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1744
1763
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1764
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1745
1765
|
}, z.core.$strict>>;
|
|
1746
1766
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1747
1767
|
[x: string]: string;
|
|
@@ -1754,6 +1774,7 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
1754
1774
|
speechOptions: z.ZodOptional<z.ZodObject<{
|
|
1755
1775
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1756
1776
|
instruction: z.ZodOptional<z.ZodString>;
|
|
1777
|
+
decoration: z.ZodOptional<z.ZodString>;
|
|
1757
1778
|
}, z.core.$strict>>;
|
|
1758
1779
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
1759
1780
|
[x: string]: string;
|
package/lib/types/schema.js
CHANGED
|
@@ -18,8 +18,9 @@ export const localizedTextSchema = z
|
|
|
18
18
|
export const multiLingualTextsSchema = z.record(langSchema, localizedTextSchema);
|
|
19
19
|
export const speechOptionsSchema = z
|
|
20
20
|
.object({
|
|
21
|
-
speed: z.number().optional(), // default: 1.0
|
|
22
|
-
instruction: z.string().optional(),
|
|
21
|
+
speed: z.number().optional(), // default: 1.0 for google and niji voice
|
|
22
|
+
instruction: z.string().optional(), // for tts openai
|
|
23
|
+
decoration: z.string().optional(), // for kotodama. default: neutral
|
|
23
24
|
})
|
|
24
25
|
.strict();
|
|
25
26
|
const speakerIdSchema = z.string();
|
package/lib/utils/const.d.ts
CHANGED
package/lib/utils/const.js
CHANGED
package/lib/utils/context.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
17
17
|
speechOptions?: {
|
|
18
18
|
speed?: number | undefined;
|
|
19
19
|
instruction?: string | undefined;
|
|
20
|
+
decoration?: string | undefined;
|
|
20
21
|
} | undefined;
|
|
21
22
|
provider?: string | undefined;
|
|
22
23
|
model?: string | undefined;
|
|
@@ -27,6 +28,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
27
28
|
speechOptions?: {
|
|
28
29
|
speed?: number | undefined;
|
|
29
30
|
instruction?: string | undefined;
|
|
31
|
+
decoration?: string | undefined;
|
|
30
32
|
} | undefined;
|
|
31
33
|
provider?: string | undefined;
|
|
32
34
|
model?: string | undefined;
|
|
@@ -242,6 +244,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
242
244
|
speechOptions?: {
|
|
243
245
|
speed?: number | undefined;
|
|
244
246
|
instruction?: string | undefined;
|
|
247
|
+
decoration?: string | undefined;
|
|
245
248
|
} | undefined;
|
|
246
249
|
textSlideParams?: {
|
|
247
250
|
cssStyles: string | string[];
|
|
@@ -332,6 +335,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
332
335
|
speechOptions?: {
|
|
333
336
|
speed?: number | undefined;
|
|
334
337
|
instruction?: string | undefined;
|
|
338
|
+
decoration?: string | undefined;
|
|
335
339
|
} | undefined;
|
|
336
340
|
provider?: string | undefined;
|
|
337
341
|
model?: string | undefined;
|
|
@@ -342,6 +346,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
342
346
|
speechOptions?: {
|
|
343
347
|
speed?: number | undefined;
|
|
344
348
|
instruction?: string | undefined;
|
|
349
|
+
decoration?: string | undefined;
|
|
345
350
|
} | undefined;
|
|
346
351
|
provider?: string | undefined;
|
|
347
352
|
model?: string | undefined;
|
|
@@ -557,6 +562,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
557
562
|
speechOptions?: {
|
|
558
563
|
speed?: number | undefined;
|
|
559
564
|
instruction?: string | undefined;
|
|
565
|
+
decoration?: string | undefined;
|
|
560
566
|
} | undefined;
|
|
561
567
|
textSlideParams?: {
|
|
562
568
|
cssStyles: string | string[];
|
|
@@ -654,6 +660,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
654
660
|
speechOptions?: {
|
|
655
661
|
speed?: number | undefined;
|
|
656
662
|
instruction?: string | undefined;
|
|
663
|
+
decoration?: string | undefined;
|
|
657
664
|
} | undefined;
|
|
658
665
|
provider?: string | undefined;
|
|
659
666
|
model?: string | undefined;
|
|
@@ -664,6 +671,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
664
671
|
speechOptions?: {
|
|
665
672
|
speed?: number | undefined;
|
|
666
673
|
instruction?: string | undefined;
|
|
674
|
+
decoration?: string | undefined;
|
|
667
675
|
} | undefined;
|
|
668
676
|
provider?: string | undefined;
|
|
669
677
|
model?: string | undefined;
|
|
@@ -197,3 +197,13 @@ export declare const translateApiKeyMissingError: () => {
|
|
|
197
197
|
export declare const hasCause: (err: unknown) => err is Error & {
|
|
198
198
|
cause: unknown;
|
|
199
199
|
};
|
|
200
|
+
type Result<T> = {
|
|
201
|
+
ok: true;
|
|
202
|
+
value: T;
|
|
203
|
+
} | {
|
|
204
|
+
ok: false;
|
|
205
|
+
error: Error;
|
|
206
|
+
};
|
|
207
|
+
export declare function resultify<T>(fn: () => Promise<T>): Promise<Result<T>>;
|
|
208
|
+
export declare const getGenAIErrorReason: (error: Error) => any;
|
|
209
|
+
export {};
|
package/lib/utils/error_cause.js
CHANGED
|
@@ -226,3 +226,25 @@ export const translateApiKeyMissingError = () => {
|
|
|
226
226
|
export const hasCause = (err) => {
|
|
227
227
|
return err instanceof Error && "cause" in err;
|
|
228
228
|
};
|
|
229
|
+
export async function resultify(fn) {
|
|
230
|
+
try {
|
|
231
|
+
return { ok: true, value: await fn() };
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
return { ok: false, error: error };
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
export const getGenAIErrorReason = (error) => {
|
|
238
|
+
try {
|
|
239
|
+
if (error instanceof Error && error.message && error.message[0] === "{") {
|
|
240
|
+
const reasonDetail = JSON.parse(error.message).error.details.find((detail) => detail.reason);
|
|
241
|
+
if (reasonDetail) {
|
|
242
|
+
return reasonDetail;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
catch (__error) {
|
|
247
|
+
// nothing.
|
|
248
|
+
}
|
|
249
|
+
return undefined;
|
|
250
|
+
};
|
|
@@ -29,6 +29,13 @@ export declare const provider2TTSAgent: {
|
|
|
29
29
|
models: string[];
|
|
30
30
|
keyName: string;
|
|
31
31
|
};
|
|
32
|
+
kotodama: {
|
|
33
|
+
agentName: string;
|
|
34
|
+
hasLimitedConcurrency: boolean;
|
|
35
|
+
defaultVoice: string;
|
|
36
|
+
defaultDecoration: string;
|
|
37
|
+
keyName: string;
|
|
38
|
+
};
|
|
32
39
|
mock: {
|
|
33
40
|
agentName: string;
|
|
34
41
|
hasLimitedConcurrency: boolean;
|
|
@@ -32,6 +32,13 @@ export const provider2TTSAgent = {
|
|
|
32
32
|
models: ["eleven_multilingual_v2", "eleven_turbo_v2_5", "eleven_turbo_v2", "eleven_flash_v2_5", "eleven_flash_v2"],
|
|
33
33
|
keyName: "ELEVENLABS_API_KEY",
|
|
34
34
|
},
|
|
35
|
+
kotodama: {
|
|
36
|
+
agentName: "ttsKotodamaAgent",
|
|
37
|
+
hasLimitedConcurrency: true,
|
|
38
|
+
defaultVoice: "Atla",
|
|
39
|
+
defaultDecoration: "neutral",
|
|
40
|
+
keyName: "KOTODAMA_API_KEY",
|
|
41
|
+
},
|
|
35
42
|
mock: {
|
|
36
43
|
agentName: "mediaMockAgent",
|
|
37
44
|
hasLimitedConcurrency: true,
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -35,4 +35,8 @@ export declare const multiLingualObjectToArray: (multiLingual: MulmoStudioMultiL
|
|
|
35
35
|
}>;
|
|
36
36
|
cacheKey?: string | undefined;
|
|
37
37
|
}[];
|
|
38
|
+
export declare const getAspectRatio: (canvasSize: {
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
}, ASPECT_RATIOS: string[]) => string;
|
|
38
42
|
export {};
|
package/lib/utils/utils.js
CHANGED
|
@@ -47,9 +47,8 @@ export const settings2GraphAIConfig = (settings, env) => {
|
|
|
47
47
|
apiKey: getKey("LLM", "OPENAI_API_KEY"),
|
|
48
48
|
baseURL: getKey("LLM", "OPENAI_BASE_URL"),
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
apiKey: getKey("
|
|
52
|
-
baseURL: getKey("TTS", "OPENAI_BASE_URL"),
|
|
50
|
+
anthropicAgent: {
|
|
51
|
+
apiKey: getKey("LLM", "ANTHROPIC_API_TOKEN"),
|
|
53
52
|
},
|
|
54
53
|
imageOpenaiAgent: {
|
|
55
54
|
apiKey: getKey("IMAGE", "OPENAI_API_KEY"),
|
|
@@ -61,24 +60,31 @@ export const settings2GraphAIConfig = (settings, env) => {
|
|
|
61
60
|
imageGenAIAgent: {
|
|
62
61
|
apiKey: getKey("IMAGE", "GEMINI_API_KEY"),
|
|
63
62
|
},
|
|
64
|
-
anthropicAgent: {
|
|
65
|
-
apiKey: getKey("LLM", "ANTHROPIC_API_TOKEN"),
|
|
66
|
-
},
|
|
67
63
|
movieReplicateAgent: {
|
|
68
64
|
apiKey: getKey("MOVIE", "REPLICATE_API_TOKEN"),
|
|
69
65
|
},
|
|
70
66
|
movieGenAIAgent: {
|
|
71
67
|
apiKey: getKey("MOVIE", "GEMINI_API_KEY"),
|
|
72
68
|
},
|
|
69
|
+
ttsOpenaiAgent: {
|
|
70
|
+
apiKey: getKey("TTS", "OPENAI_API_KEY"),
|
|
71
|
+
baseURL: getKey("TTS", "OPENAI_BASE_URL"),
|
|
72
|
+
},
|
|
73
73
|
ttsNijivoiceAgent: {
|
|
74
74
|
apiKey: getKey("TTS", "NIJIVOICE_API_KEY"),
|
|
75
75
|
},
|
|
76
|
+
ttsGoogleAgent: {
|
|
77
|
+
apiKey: getKey("TTS", "GEMINI_API_KEY"),
|
|
78
|
+
},
|
|
76
79
|
ttsGeminiAgent: {
|
|
77
80
|
apiKey: getKey("TTS", "GEMINI_API_KEY"),
|
|
78
81
|
},
|
|
79
82
|
ttsElevenlabsAgent: {
|
|
80
83
|
apiKey: getKey("TTS", "ELEVENLABS_API_KEY"),
|
|
81
84
|
},
|
|
85
|
+
ttsKotodamaAgent: {
|
|
86
|
+
apiKey: getKey("TTS", "KOTODAMA_API_KEY"),
|
|
87
|
+
},
|
|
82
88
|
soundEffectReplicateAgent: {
|
|
83
89
|
apiKey: getKey("SOUND_EFFECT", "REPLICATE_API_TOKEN"),
|
|
84
90
|
},
|
|
@@ -126,3 +132,12 @@ export const multiLingualObjectToArray = (multiLingual, beats) => {
|
|
|
126
132
|
return { multiLingualTexts: {} };
|
|
127
133
|
});
|
|
128
134
|
};
|
|
135
|
+
export const getAspectRatio = (canvasSize, ASPECT_RATIOS) => {
|
|
136
|
+
const target = canvasSize.width / canvasSize.height;
|
|
137
|
+
return ASPECT_RATIOS.reduce((best, ratio) => {
|
|
138
|
+
const [w, h] = ratio.split(":").map(Number);
|
|
139
|
+
const r = w / h;
|
|
140
|
+
const diff = Math.abs(target - r);
|
|
141
|
+
return diff < best.diff ? { ratio, diff } : best;
|
|
142
|
+
}, { ratio: ASPECT_RATIOS[0], diff: Infinity }).ratio;
|
|
143
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.node.js",
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@google-cloud/text-to-speech": "^6.4.0",
|
|
77
77
|
"@google/genai": "^1.30.0",
|
|
78
|
-
"@graphai/anthropic_agent": "^2.0.
|
|
78
|
+
"@graphai/anthropic_agent": "^2.0.12",
|
|
79
79
|
"@graphai/browserless_agent": "^2.0.1",
|
|
80
80
|
"@graphai/gemini_agent": "^2.0.1",
|
|
81
81
|
"@graphai/groq_agent": "^2.0.2",
|
|
82
82
|
"@graphai/input_agents": "^1.0.2",
|
|
83
|
-
"@graphai/openai_agent": "^2.0.
|
|
83
|
+
"@graphai/openai_agent": "^2.0.8",
|
|
84
84
|
"@graphai/stream_agent_filter": "^2.0.2",
|
|
85
85
|
"@graphai/vanilla": "^2.0.12",
|
|
86
86
|
"@graphai/vanilla_node_agents": "^2.0.4",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"eslint-config-prettier": "^10.1.8",
|
|
115
115
|
"eslint-plugin-prettier": "^5.5.4",
|
|
116
116
|
"eslint-plugin-sonarjs": "^3.0.5",
|
|
117
|
-
"prettier": "^3.
|
|
117
|
+
"prettier": "^3.7.1",
|
|
118
118
|
"tsx": "^4.20.6",
|
|
119
119
|
"typescript": "^5.9.3",
|
|
120
120
|
"typescript-eslint": "^8.48.0"
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# MulmoCast Test Scripts
|
|
2
|
+
|
|
3
|
+
このディレクトリには、MulmoCastの機能テスト用のMulmoScriptサンプルが含まれています。
|
|
4
|
+
|
|
5
|
+
This directory contains MulmoScript samples for testing MulmoCast features.
|
|
6
|
+
|
|
7
|
+
## 📋 テストカテゴリ / Test Categories
|
|
8
|
+
|
|
9
|
+
### 🎯 基本テスト / Basic Tests
|
|
10
|
+
|
|
11
|
+
**シンプルな動作確認用のテストスクリプト**
|
|
12
|
+
|
|
13
|
+
Simple test scripts for basic functionality verification
|
|
14
|
+
|
|
15
|
+
- **test_hello.json** - 最もシンプルなHello Worldテスト / Simplest Hello World test
|
|
16
|
+
- **test.json** - 基本的な動作テスト / Basic functionality test
|
|
17
|
+
- **test1.json**, **test2.json** - 追加の基本テスト / Additional basic tests
|
|
18
|
+
- **test_beats.json** - Beatの基本機能テスト / Beat basic features test
|
|
19
|
+
|
|
20
|
+
### 🎤 TTS(音声合成)テスト / TTS (Text-to-Speech) Tests
|
|
21
|
+
|
|
22
|
+
**各種音声合成プロバイダーのテスト**
|
|
23
|
+
|
|
24
|
+
Tests for various TTS providers
|
|
25
|
+
|
|
26
|
+
- **test_all_tts.json** - 全TTSプロバイダーのテスト(OpenAI, Gemini, Google, ElevenLabs, Nijivoice) / All TTS providers test
|
|
27
|
+
- **test_audio.json** - 音声パラメータのテスト(padding, duration, movieVolumeなど) / Audio parameters test
|
|
28
|
+
- **test_audio_gemini.json** - Gemini TTSの個別テスト / Gemini TTS specific test
|
|
29
|
+
- **test_audio_instructions.json** - OpenAI TTS instructionsのテスト / OpenAI TTS instructions test
|
|
30
|
+
- **test_elevenlabs_models.json** - ElevenLabsの複数モデルテスト / ElevenLabs multiple models test
|
|
31
|
+
- **test_voices.json** - 複数の音声設定テスト / Multiple voice settings test
|
|
32
|
+
- **test_mixed_providers.json** - 複数のTTSプロバイダー混在テスト / Mixed TTS providers test
|
|
33
|
+
|
|
34
|
+
### 🖼️ 画像生成テスト / Image Generation Tests
|
|
35
|
+
|
|
36
|
+
**画像生成機能のテスト**
|
|
37
|
+
|
|
38
|
+
Image generation feature tests
|
|
39
|
+
|
|
40
|
+
- **test_images.json** - 画像生成の基本テスト / Basic image generation test
|
|
41
|
+
- **test_hello_image.json** - Hello World画像テスト / Hello World image test
|
|
42
|
+
- **test_image_refs.json** - 参照画像を使った生成テスト / Image generation with references
|
|
43
|
+
- **test_markdown.json** - Markdown形式の画像テスト / Markdown format image test
|
|
44
|
+
- **test_html.json** - HTMLから画像生成テスト / HTML to image test
|
|
45
|
+
- **test_vision.json** - Vision APIを使った画像生成テスト / Vision API image test
|
|
46
|
+
- **test_layout.json** - レイアウト機能のテスト / Layout features test
|
|
47
|
+
|
|
48
|
+
### 🎬 動画生成テスト / Video Generation Tests
|
|
49
|
+
|
|
50
|
+
**動画生成機能のテスト**
|
|
51
|
+
|
|
52
|
+
Video generation feature tests
|
|
53
|
+
|
|
54
|
+
- **test_movie.json** - 動画生成の基本テスト(imagePrompt + moviePrompt) / Basic video generation test
|
|
55
|
+
- **test_movie2.json** - 動画生成の追加テスト / Additional video generation test
|
|
56
|
+
- **test_genai_movie.json** - GenAI動画生成テスト / GenAI video generation test
|
|
57
|
+
- **test_genai.json** - GenAI機能テスト / GenAI features test
|
|
58
|
+
- **test_replicate.json** - Replicate動画生成テスト / Replicate video generation test
|
|
59
|
+
- **test_mv.json** - ミュージックビデオ形式のテスト / Music video format test
|
|
60
|
+
|
|
61
|
+
### 🎭 高度な機能テスト / Advanced Feature Tests
|
|
62
|
+
|
|
63
|
+
**特殊機能や複雑なシナリオのテスト**
|
|
64
|
+
|
|
65
|
+
Special features and complex scenario tests
|
|
66
|
+
|
|
67
|
+
- **test_spillover.json** - 音声スピルオーバー機能テスト / Audio spillover feature test
|
|
68
|
+
- **test_lipsync.json** - リップシンク機能テスト / Lip-sync feature test
|
|
69
|
+
- **test_transition.json** - トランジション効果テスト / Transition effects test
|
|
70
|
+
- **test_transition_no_audio.json** - 音声なしトランジションテスト / Transition without audio test
|
|
71
|
+
- **test_slideout_left_no_audio.json** - スライドアウト効果テスト / Slide-out effect test
|
|
72
|
+
- **test_sound_effect.json** - サウンドエフェクトテスト / Sound effect test
|
|
73
|
+
- **test_voice_over.json** - ボイスオーバー機能テスト / Voice-over feature test
|
|
74
|
+
- **test_captions.json** - 字幕機能テスト / Caption feature test
|
|
75
|
+
- **test_hello_caption.json** - Hello World字幕テスト / Hello World caption test
|
|
76
|
+
- **test_loop.json** - ループ再生テスト / Loop playback test
|
|
77
|
+
- **test_video_speed.json** - 動画速度調整テスト / Video speed adjustment test
|
|
78
|
+
|
|
79
|
+
### 🔧 特殊条件テスト / Special Condition Tests
|
|
80
|
+
|
|
81
|
+
**エッジケースや特殊な条件のテスト**
|
|
82
|
+
|
|
83
|
+
Edge cases and special condition tests
|
|
84
|
+
|
|
85
|
+
- **test_no_audio.json** - 音声なし動画テスト / Video without audio test
|
|
86
|
+
- **test_no_audio_with_credit.json** - クレジット付き音声なしテスト / No audio with credits test
|
|
87
|
+
- **test_hello_nobgm.json** - BGMなしテスト / Test without BGM
|
|
88
|
+
- **test_size_error.json** - サイズエラーテスト / Size error test
|
|
89
|
+
- **test_media.json** - メディアファイル処理テスト / Media file processing test
|
|
90
|
+
- **test_order.json** - 順序処理テスト / Order processing test
|
|
91
|
+
- **test_order_portrait.json** - 縦向き順序テスト / Portrait order test
|
|
92
|
+
|
|
93
|
+
### 🌍 多言語テスト / Multi-language Tests
|
|
94
|
+
|
|
95
|
+
**言語設定のテスト**
|
|
96
|
+
|
|
97
|
+
Language setting tests
|
|
98
|
+
|
|
99
|
+
- **test_lang.json** - 多言語サポートテスト / Multi-language support test
|
|
100
|
+
- **test_en.json** - 英語専用テスト / English-only test
|
|
101
|
+
|
|
102
|
+
### 🎯 プロバイダー別テスト / Provider-Specific Tests
|
|
103
|
+
|
|
104
|
+
**特定プロバイダーの機能テスト**
|
|
105
|
+
|
|
106
|
+
Provider-specific feature tests
|
|
107
|
+
|
|
108
|
+
- **test_hello_google.json** - Google TTS専用テスト / Google TTS specific test
|
|
109
|
+
- **gpt.json** - GPTモデルテスト / GPT model test
|
|
110
|
+
- **mulmo_story.json** - ストーリー形式テスト / Story format test
|
|
111
|
+
- **nano_banana.json** - カスタムサンプル / Custom sample
|
|
112
|
+
|
|
113
|
+
## 🚀 使い方 / Usage
|
|
114
|
+
|
|
115
|
+
### 基本的な実行方法 / Basic Execution
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# 動画生成
|
|
119
|
+
# Generate video
|
|
120
|
+
yarn movie scripts/test/test_hello.json
|
|
121
|
+
|
|
122
|
+
# 音声のみ生成
|
|
123
|
+
# Generate audio only
|
|
124
|
+
yarn audio scripts/test/test_audio.json
|
|
125
|
+
|
|
126
|
+
# 画像のみ生成
|
|
127
|
+
# Generate images only
|
|
128
|
+
yarn images scripts/test/test_images.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 強制再生成 / Force Regeneration
|
|
132
|
+
|
|
133
|
+
キャッシュを無視して再生成する場合は `-f` フラグを使用:
|
|
134
|
+
|
|
135
|
+
Use the `-f` flag to ignore cache and regenerate:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
yarn movie scripts/test/test_hello.json -f
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 📝 テストスクリプト作成のヒント / Tips for Creating Test Scripts
|
|
142
|
+
|
|
143
|
+
1. **シンプルから始める** - `test_hello.json` を参考に基本構造を理解
|
|
144
|
+
2. **機能を段階的に追加** - 一度に複数の機能をテストせず、段階的に追加
|
|
145
|
+
3. **既存のテストを参考にする** - 同じカテゴリのテストスクリプトを参考に
|
|
146
|
+
4. **適切な命名** - `test_<feature>.json` の形式で目的が分かりやすい名前を付ける
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
1. **Start simple** - Refer to `test_hello.json` to understand basic structure
|
|
151
|
+
2. **Add features incrementally** - Don't test multiple features at once
|
|
152
|
+
3. **Reference existing tests** - Look at tests in the same category
|
|
153
|
+
4. **Use descriptive naming** - Use `test_<feature>.json` format for clarity
|
|
154
|
+
|
|
155
|
+
## 🔗 関連ドキュメント / Related Documentation
|
|
156
|
+
|
|
157
|
+
- [メインREADME](../../README.md)
|
|
158
|
+
- [MulmoScript Schema](../../docs/schena.md)
|
|
159
|
+
- [TTS Provider追加手順](../../docs/tts.md)
|
|
160
|
+
- [Image Plugin仕様](../../docs/image_plugin.md)
|
|
161
|
+
- [音声スピルオーバー](../../docs/sound_and_voice.md)
|