mulmocast 1.1.5 → 1.1.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/actions/audio.js +10 -1
- package/lib/actions/image_agents.d.ts +3 -12
- package/lib/actions/image_agents.js +12 -8
- package/lib/actions/images.js +2 -1
- package/lib/actions/translate.d.ts +51 -2
- package/lib/actions/translate.js +193 -148
- package/lib/agents/combine_audio_files_agent.js +1 -1
- package/lib/agents/lipsync_replicate_agent.js +10 -3
- package/lib/agents/tts_nijivoice_agent.js +1 -1
- package/lib/cli/commands/audio/handler.js +1 -1
- package/lib/cli/commands/image/handler.js +1 -1
- package/lib/cli/commands/movie/handler.js +1 -1
- package/lib/cli/commands/pdf/handler.js +1 -1
- package/lib/cli/helpers.d.ts +1 -4
- package/lib/cli/helpers.js +3 -2
- package/lib/index.common.d.ts +1 -0
- package/lib/index.common.js +1 -0
- package/lib/mcp/server.js +1 -1
- package/lib/methods/mulmo_presentation_style.d.ts +3 -2
- package/lib/methods/mulmo_script.d.ts +4 -1
- package/lib/methods/mulmo_script.js +18 -2
- package/lib/methods/mulmo_studio_context.d.ts +1 -0
- package/lib/methods/mulmo_studio_context.js +8 -0
- package/lib/types/agent.d.ts +1 -0
- package/lib/types/schema.d.ts +326 -230
- package/lib/types/schema.js +10 -3
- package/lib/types/type.d.ts +3 -2
- package/lib/utils/const.d.ts +1 -0
- package/lib/utils/const.js +2 -1
- package/lib/utils/context.d.ts +393 -50
- package/lib/utils/context.js +90 -57
- package/lib/utils/filters.d.ts +1 -0
- package/lib/utils/filters.js +8 -0
- package/lib/utils/image_plugins/mermaid.js +1 -1
- package/lib/utils/image_plugins/source.js +1 -1
- package/lib/utils/preprocess.d.ts +2 -2
- package/lib/utils/preprocess.js +3 -3
- package/lib/utils/provider2agent.d.ts +3 -2
- package/lib/utils/provider2agent.js +20 -2
- package/lib/utils/string.d.ts +1 -1
- package/lib/utils/string.js +12 -8
- package/lib/utils/utils.js +2 -6
- package/package.json +2 -2
- package/scripts/templates/image_refs.json +1 -0
- package/scripts/templates/voice_over.json +1 -0
- package/scripts/test/gpt.json +1 -0
- package/scripts/test/test1.json +1 -0
- package/scripts/test/test_audio.json +1 -0
- package/scripts/test/test_audio_instructions.json +1 -0
- package/scripts/test/test_beats.json +1 -0
- package/scripts/test/test_captions.json +1 -0
- package/scripts/test/test_elevenlabs_models.json +1 -0
- package/scripts/test/test_hello.json +1 -0
- package/scripts/test/test_hello_google.json +1 -0
- package/scripts/test/test_html.json +1 -0
- package/scripts/test/test_image_refs.json +1 -0
- package/scripts/test/test_images.json +1 -0
- package/scripts/test/test_lang.json +58 -2
- package/scripts/test/test_layout.json +1 -0
- package/scripts/test/test_lipsync.json +9 -0
- package/scripts/test/test_loop.json +1 -0
- package/scripts/test/test_media.json +1 -0
- package/scripts/test/test_mixed_providers.json +1 -0
- package/scripts/test/test_movie.json +1 -0
- package/scripts/test/test_no_audio.json +1 -0
- package/scripts/test/test_no_audio_with_credit.json +1 -0
- package/scripts/test/test_order.json +1 -0
- package/scripts/test/test_order_portrait.json +1 -0
- package/scripts/test/test_replicate.json +19 -0
- package/scripts/test/test_slideout_left_no_audio.json +1 -0
- package/scripts/test/test_spillover.json +1 -0
- package/scripts/test/test_transition.json +1 -0
- package/scripts/test/test_transition_no_audio.json +1 -0
- package/scripts/test/test_video_speed.json +1 -0
- package/scripts/test/test_voice_over.json +1 -0
- package/scripts/test/test_voices.json +1 -0
- package/scripts/templates/image_prompt_only_template.ts +0 -95
package/lib/cli/helpers.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { CliArgs } from "../types/cli_types.js";
|
|
2
2
|
import { FileObject, InitOptions, MulmoStudioContext } from "../types/index.js";
|
|
3
|
-
export declare const runTranslateIfNeeded: (context: MulmoStudioContext,
|
|
4
|
-
l?: string;
|
|
5
|
-
c?: string;
|
|
6
|
-
}) => Promise<void>;
|
|
3
|
+
export declare const runTranslateIfNeeded: (context: MulmoStudioContext, includeCaption?: boolean) => Promise<void>;
|
|
7
4
|
export declare const setGraphAILogger: (verbose: boolean | undefined, logValues?: Record<string, unknown>) => void;
|
|
8
5
|
export declare const getFileObject: (args: {
|
|
9
6
|
basedir?: string;
|
package/lib/cli/helpers.js
CHANGED
|
@@ -5,10 +5,11 @@ import clipboardy from "clipboardy";
|
|
|
5
5
|
import { getBaseDirPath, getFullPath, getOutputStudioFilePath, resolveDirPath, mkdir, getOutputMultilingualFilePath, generateTimestampedFileName, } from "../utils/file.js";
|
|
6
6
|
import { isHttp } from "../utils/utils.js";
|
|
7
7
|
import { outDirName, imageDirName, audioDirName } from "../utils/const.js";
|
|
8
|
+
import { MulmoStudioContextMethods } from "../methods/mulmo_studio_context.js";
|
|
8
9
|
import { translate } from "../actions/translate.js";
|
|
9
10
|
import { initializeContextFromFiles } from "../utils/context.js";
|
|
10
|
-
export const runTranslateIfNeeded = async (context,
|
|
11
|
-
if (
|
|
11
|
+
export const runTranslateIfNeeded = async (context, includeCaption = false) => {
|
|
12
|
+
if (MulmoStudioContextMethods.needTranslate(context, includeCaption)) {
|
|
12
13
|
GraphAILogger.log("run translate");
|
|
13
14
|
await translate(context);
|
|
14
15
|
}
|
package/lib/index.common.d.ts
CHANGED
package/lib/index.common.js
CHANGED
package/lib/mcp/server.js
CHANGED
|
@@ -104,7 +104,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
104
104
|
throw new Error("Failed to initialize context from MulmoScript");
|
|
105
105
|
}
|
|
106
106
|
// Run translation if needed
|
|
107
|
-
await runTranslateIfNeeded(context
|
|
107
|
+
await runTranslateIfNeeded(context);
|
|
108
108
|
// Execute the requested command
|
|
109
109
|
switch (cmd) {
|
|
110
110
|
case "movie":
|
|
@@ -36,9 +36,10 @@ export declare const MulmoPresentationStyleMethods: {
|
|
|
36
36
|
defaultModel: import("../utils/provider2agent.js").ReplicateModel;
|
|
37
37
|
models: import("../utils/provider2agent.js").ReplicateModel[];
|
|
38
38
|
modelParams: Record<import("../utils/provider2agent.js").ReplicateModel, {
|
|
39
|
-
identifier?: `${string}/${string}:${string}`;
|
|
40
|
-
video
|
|
39
|
+
identifier?: `${string}/${string}:${string}` | `${string}/${string}`;
|
|
40
|
+
video?: string;
|
|
41
41
|
audio: string;
|
|
42
|
+
image?: string;
|
|
42
43
|
}>;
|
|
43
44
|
};
|
|
44
45
|
getConcurrency(presentationStyle: MulmoPresentationStyle): 4 | 16;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { MulmoScript } from "../types/index.js";
|
|
1
|
+
import { type MulmoScript, type MulmoStudioMultiLingual } from "../types/index.js";
|
|
2
2
|
export declare const MulmoScriptMethods: {
|
|
3
3
|
validate(script: any): MulmoScript;
|
|
4
4
|
};
|
|
5
|
+
export declare const MulmoStudioMultiLingualMethod: {
|
|
6
|
+
validate(jsonData: any, studioBeatsLength: number): MulmoStudioMultiLingual;
|
|
7
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mulmoScriptSchema } from "../types/index.js";
|
|
1
|
+
import { mulmoScriptSchema, mulmoStudioMultiLingualFileSchema } from "../types/index.js";
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
3
|
const validate_1_0 = (script) => {
|
|
4
4
|
if (script.speechParams?.provider) {
|
|
@@ -18,6 +18,9 @@ const validators = [{ from: "1.0", to: "1.1", validator: validate_1_0 }];
|
|
|
18
18
|
export const MulmoScriptMethods = {
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
20
|
validate(script) {
|
|
21
|
+
const version = script.$mulmocast.version;
|
|
22
|
+
// lang was optional in 1.0 and 1.1
|
|
23
|
+
const defaultLang = version === "1.0" || version === "1.1" ? { lang: "en" } : {};
|
|
21
24
|
const validatedScript = validators.reduce((acc, validator) => {
|
|
22
25
|
if (acc.$mulmocast.version === validator.from) {
|
|
23
26
|
const validated = validator.validator(acc);
|
|
@@ -25,7 +28,20 @@ export const MulmoScriptMethods = {
|
|
|
25
28
|
return validated;
|
|
26
29
|
}
|
|
27
30
|
return acc;
|
|
28
|
-
}, script);
|
|
31
|
+
}, { ...defaultLang, ...script });
|
|
29
32
|
return mulmoScriptSchema.parse(validatedScript);
|
|
30
33
|
},
|
|
31
34
|
};
|
|
35
|
+
export const MulmoStudioMultiLingualMethod = {
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
validate(jsonData, studioBeatsLength) {
|
|
38
|
+
// TODO version check
|
|
39
|
+
const result = mulmoStudioMultiLingualFileSchema.safeParse(jsonData);
|
|
40
|
+
const dataSet = result.success ? result.data.multiLingual : [];
|
|
41
|
+
while (dataSet.length < studioBeatsLength) {
|
|
42
|
+
dataSet.push({ multiLingualTexts: {} });
|
|
43
|
+
}
|
|
44
|
+
dataSet.length = studioBeatsLength;
|
|
45
|
+
return dataSet;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -11,4 +11,5 @@ export declare const MulmoStudioContextMethods: {
|
|
|
11
11
|
getCaption(context: MulmoStudioContext): string | undefined;
|
|
12
12
|
setSessionState(context: MulmoStudioContext, sessionType: SessionType, value: boolean): void;
|
|
13
13
|
setBeatSessionState(context: MulmoStudioContext, sessionType: BeatSessionType, index: number, value: boolean): void;
|
|
14
|
+
needTranslate(context: MulmoStudioContext, includeCaption?: boolean): boolean | "" | undefined;
|
|
14
15
|
};
|
|
@@ -63,4 +63,12 @@ export const MulmoStudioContextMethods = {
|
|
|
63
63
|
}
|
|
64
64
|
notifyBeatStateChange(context, sessionType, index);
|
|
65
65
|
},
|
|
66
|
+
needTranslate(context, includeCaption = false) {
|
|
67
|
+
// context.studio.script.lang = defaultLang, context.lang = targetLanguage.
|
|
68
|
+
if (includeCaption) {
|
|
69
|
+
return (context.studio.script.lang !== context.lang ||
|
|
70
|
+
(context.studio.script.captionParams?.lang && context.studio.script.lang !== context.studio.script.captionParams?.lang));
|
|
71
|
+
}
|
|
72
|
+
return context.studio.script.lang !== context.lang;
|
|
73
|
+
},
|
|
66
74
|
};
|
package/lib/types/agent.d.ts
CHANGED