mulmocast 0.0.5 → 0.0.6
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/README.md +257 -39
- package/assets/audio/silent60sec.mp3 +0 -0
- package/assets/html/caption.html +45 -0
- package/assets/html/chart.html +1 -1
- package/assets/html/mermaid.html +6 -2
- package/assets/html/tailwind.html +13 -0
- package/assets/templates/business.json +57 -4
- package/assets/templates/comic_strips.json +35 -0
- package/assets/templates/ghibli_strips.json +35 -0
- package/lib/actions/audio.js +24 -11
- package/lib/actions/captions.d.ts +2 -0
- package/lib/actions/captions.js +62 -0
- package/lib/actions/images.js +3 -2
- package/lib/actions/index.d.ts +1 -0
- package/lib/actions/index.js +1 -0
- package/lib/actions/movie.js +78 -86
- package/lib/actions/pdf.js +15 -5
- package/lib/actions/translate.js +32 -26
- package/lib/agents/add_bgm_agent.js +15 -39
- package/lib/agents/combine_audio_files_agent.js +43 -36
- package/lib/agents/index.d.ts +2 -3
- package/lib/agents/index.js +2 -3
- package/lib/agents/tts_google_agent.d.ts +4 -0
- package/lib/agents/tts_google_agent.js +51 -0
- package/lib/agents/validate_schema_agent.d.ts +19 -0
- package/lib/agents/validate_schema_agent.js +36 -0
- package/lib/cli/args.d.ts +2 -0
- package/lib/cli/args.js +9 -2
- package/lib/cli/bin.d.ts +3 -0
- package/lib/cli/bin.js +38 -0
- package/lib/cli/cli.js +34 -7
- package/lib/cli/commands/audio/builder.d.ts +14 -0
- package/lib/cli/commands/audio/builder.js +6 -0
- package/lib/cli/commands/audio/handler.d.ts +4 -0
- package/lib/cli/commands/audio/handler.js +7 -0
- package/lib/cli/commands/audio/index.d.ts +4 -0
- package/lib/cli/commands/audio/index.js +4 -0
- package/lib/cli/commands/image/builder.d.ts +14 -0
- package/lib/cli/commands/image/builder.js +6 -0
- package/lib/cli/commands/image/handler.d.ts +4 -0
- package/lib/cli/commands/image/handler.js +7 -0
- package/lib/cli/commands/image/index.d.ts +4 -0
- package/lib/cli/commands/image/index.js +4 -0
- package/lib/cli/commands/movie/builder.d.ts +18 -0
- package/lib/cli/commands/movie/builder.js +19 -0
- package/lib/cli/commands/movie/handler.d.ts +6 -0
- package/lib/cli/commands/movie/handler.js +12 -0
- package/lib/cli/commands/movie/index.d.ts +4 -0
- package/lib/cli/commands/movie/index.js +4 -0
- package/lib/cli/commands/pdf/builder.d.ts +18 -0
- package/lib/cli/commands/pdf/builder.js +19 -0
- package/lib/cli/commands/pdf/handler.d.ts +6 -0
- package/lib/cli/commands/pdf/handler.js +8 -0
- package/lib/cli/commands/pdf/index.d.ts +4 -0
- package/lib/cli/commands/pdf/index.js +4 -0
- package/lib/cli/commands/tool/index.d.ts +6 -0
- package/lib/cli/commands/tool/index.js +8 -0
- package/lib/cli/commands/tool/prompt/builder.d.ts +4 -0
- package/lib/cli/commands/tool/prompt/builder.js +11 -0
- package/lib/cli/commands/tool/prompt/handler.d.ts +4 -0
- package/lib/cli/commands/tool/prompt/handler.js +14 -0
- package/lib/cli/commands/tool/prompt/index.d.ts +4 -0
- package/lib/cli/commands/tool/prompt/index.js +4 -0
- package/lib/cli/commands/tool/schema/builder.d.ts +2 -0
- package/lib/cli/commands/tool/schema/builder.js +3 -0
- package/lib/cli/commands/tool/schema/handler.d.ts +2 -0
- package/lib/cli/commands/tool/schema/handler.js +12 -0
- package/lib/cli/commands/tool/schema/index.d.ts +4 -0
- package/lib/cli/commands/tool/schema/index.js +4 -0
- package/lib/cli/commands/tool/scripting/builder.d.ts +20 -0
- package/lib/cli/commands/tool/scripting/builder.js +63 -0
- package/lib/cli/commands/tool/scripting/handler.d.ts +12 -0
- package/lib/cli/commands/tool/scripting/handler.js +36 -0
- package/lib/cli/commands/tool/scripting/index.d.ts +4 -0
- package/lib/cli/commands/tool/scripting/index.js +4 -0
- package/lib/cli/commands/tool/story_to_script/builder.d.ts +18 -0
- package/lib/cli/commands/tool/story_to_script/builder.js +53 -0
- package/lib/cli/commands/tool/story_to_script/handler.d.ts +11 -0
- package/lib/cli/commands/tool/story_to_script/handler.js +35 -0
- package/lib/cli/commands/tool/story_to_script/index.d.ts +4 -0
- package/lib/cli/commands/tool/story_to_script/index.js +4 -0
- package/lib/cli/commands/translate/builder.d.ts +14 -0
- package/lib/cli/commands/translate/builder.js +5 -0
- package/lib/cli/commands/translate/handler.d.ts +4 -0
- package/lib/cli/commands/translate/handler.js +6 -0
- package/lib/cli/commands/translate/index.d.ts +4 -0
- package/lib/cli/commands/translate/index.js +4 -0
- package/lib/cli/common.d.ts +6 -2
- package/lib/cli/common.js +18 -7
- package/lib/cli/helpers.d.ts +38 -0
- package/lib/cli/helpers.js +115 -0
- package/lib/cli/tool-args.d.ts +1 -0
- package/lib/cli/tool-args.js +1 -1
- package/lib/cli/tool-cli.js +8 -0
- package/lib/methods/mulmo_script.d.ts +0 -1
- package/lib/methods/mulmo_script.js +4 -7
- package/lib/methods/mulmo_script_template.js +2 -12
- package/lib/tools/create_mulmo_script_from_url.d.ts +1 -1
- package/lib/tools/create_mulmo_script_from_url.js +43 -14
- package/lib/tools/create_mulmo_script_interactively.js +14 -13
- package/lib/tools/dump_prompt.js +2 -0
- package/lib/tools/story_to_script.d.ts +10 -0
- package/lib/tools/story_to_script.js +201 -0
- package/lib/types/cli_types.d.ts +14 -0
- package/lib/types/cli_types.js +1 -0
- package/lib/types/schema.d.ts +493 -176
- package/lib/types/schema.js +37 -7
- package/lib/types/type.d.ts +6 -1
- package/lib/utils/const.d.ts +1 -0
- package/lib/utils/const.js +1 -0
- package/lib/utils/ffmpeg_utils.d.ts +12 -0
- package/lib/utils/ffmpeg_utils.js +63 -0
- package/lib/utils/file.d.ts +7 -3
- package/lib/utils/file.js +24 -5
- package/lib/utils/image_plugins/chart.js +6 -1
- package/lib/utils/image_plugins/html_tailwind.d.ts +3 -0
- package/lib/utils/image_plugins/html_tailwind.js +18 -0
- package/lib/utils/image_plugins/index.d.ts +2 -1
- package/lib/utils/image_plugins/index.js +2 -1
- package/lib/utils/image_plugins/mermaid.js +1 -1
- package/lib/utils/image_plugins/tailwind.d.ts +3 -0
- package/lib/utils/image_plugins/tailwind.js +18 -0
- package/lib/utils/image_plugins/text_slide.js +9 -2
- package/lib/utils/markdown.d.ts +1 -1
- package/lib/utils/markdown.js +8 -2
- package/lib/utils/preprocess.d.ts +23 -12
- package/lib/utils/preprocess.js +4 -0
- package/lib/utils/prompt.d.ts +15 -0
- package/lib/utils/prompt.js +57 -0
- package/lib/utils/utils.d.ts +2 -0
- package/lib/utils/utils.js +10 -0
- package/package.json +27 -23
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { mulmoScriptSchema } from "../types/schema.js";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
export const imagePrompt = (beat, style) => {
|
|
4
|
+
return (beat.imagePrompt || `generate image appropriate for the text. text: ${beat.text}`) + "\n" + (style || "");
|
|
5
|
+
};
|
|
6
|
+
// sourceTextInput: ${:sourceText.text}
|
|
7
|
+
export const graphDataScriptFromUrlPrompt = (sourceTextInput) => {
|
|
8
|
+
return `Please create a script using the information from the following URLs as reference: ${sourceTextInput}`;
|
|
9
|
+
};
|
|
10
|
+
export const graphDataScriptGeneratePrompt = (scene) => {
|
|
11
|
+
return `Please generate a script from the following scenes: ${scene}`;
|
|
12
|
+
};
|
|
13
|
+
export const getMulmoScriptTemplateSystemPrompt = (template) => {
|
|
14
|
+
// script is provided, use it as a script template
|
|
15
|
+
if (template.script) {
|
|
16
|
+
return `${template.systemPrompt}\n\`\`\`JSON\n${JSON.stringify(template.script)}\n\`\`\``;
|
|
17
|
+
}
|
|
18
|
+
// script is not provided, use the default schema
|
|
19
|
+
const defaultSchema = zodToJsonSchema(mulmoScriptSchema, {
|
|
20
|
+
strictUnions: true,
|
|
21
|
+
});
|
|
22
|
+
const specificOutputPrompt = `The output should follow the JSON schema specified below. Please provide your response as valid JSON within \`\`\`json code blocks for clarity.`;
|
|
23
|
+
return `${template.systemPrompt}\n\n${specificOutputPrompt}\n\n\`\`\`JSON\n${JSON.stringify(defaultSchema)}\n\`\`\``;
|
|
24
|
+
};
|
|
25
|
+
export const interactiveClarificationPrompt = `If there are any unclear points, be sure to ask the user questions and clarify them before generating the script.`;
|
|
26
|
+
export const prefixPrompt = "Here is the web content that can be used as reference material for the script:";
|
|
27
|
+
export const translateSystemPrompt = "Please translate the given text into the language specified in language (in locale format, like en, ja, fr, ch).";
|
|
28
|
+
export const translatePrompts = ["## Original Language", ":lang", "", "## Language", ":targetLang", "", "## Target", ":beat.text"];
|
|
29
|
+
export const sceneToBeatsPrompt = ({ sampleBeats, beatsPerScene, allScenes, }) => {
|
|
30
|
+
return `Generate scripts for the given scenes, following the structure of the sample scripts below.
|
|
31
|
+
\`\`\`JSON
|
|
32
|
+
${JSON.stringify(sampleBeats)}
|
|
33
|
+
\`\`\`
|
|
34
|
+
From the content of each scene, generate exactly ${beatsPerScene} scripts (beats).
|
|
35
|
+
The scripts should be created considering the overall content of the scenes.
|
|
36
|
+
The scenes are as follows:
|
|
37
|
+
\`\`\`
|
|
38
|
+
${allScenes}
|
|
39
|
+
\`\`\`
|
|
40
|
+
Please provide your response as valid JSON within \`\`\`json code blocks for clarity.`.trim();
|
|
41
|
+
};
|
|
42
|
+
export const storyToScriptInfoPrompt = (scriptWithoutBeats, story) => {
|
|
43
|
+
return `Generate script for the given storyboard, following the structure of the sample scripts below.
|
|
44
|
+
Storyboard:
|
|
45
|
+
- title: ${story.title}
|
|
46
|
+
- description: ${story.scenes.map((scene) => scene.description).join("\n")}
|
|
47
|
+
- references: ${story.references?.map((reference) => JSON.stringify(reference)).join("\n")}
|
|
48
|
+
|
|
49
|
+
Sample script:
|
|
50
|
+
\`\`\`JSON
|
|
51
|
+
${JSON.stringify(scriptWithoutBeats)}
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
Only include keys that exist in the sample script.
|
|
55
|
+
Do not add any keys that are not present in the sample script.
|
|
56
|
+
Please provide your response as valid JSON within \`\`\`json code blocks for clarity.`.trim();
|
|
57
|
+
};
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MulmoBeat, MulmoStudioMultiLingualData } from "../types/index.js";
|
|
1
2
|
export declare const llmAgents: string[];
|
|
2
3
|
type LLMAgent = (typeof llmAgents)[number];
|
|
3
4
|
export declare const defaultOpenAIModel: string;
|
|
@@ -9,4 +10,5 @@ export declare const llmPair: (_agent?: LLMAgent, _model?: string) => {
|
|
|
9
10
|
export declare const chunkArray: <T>(array: T[], size?: number) => T[][];
|
|
10
11
|
export declare const isHttp: (fileOrUrl: string) => boolean;
|
|
11
12
|
export declare const text2hash: (input: string) => string;
|
|
13
|
+
export declare const localizedText: (beat: MulmoBeat, multiLingualData?: MulmoStudioMultiLingualData, lang?: string) => string;
|
|
12
14
|
export {};
|
package/lib/utils/utils.js
CHANGED
|
@@ -32,3 +32,13 @@ export const isHttp = (fileOrUrl) => {
|
|
|
32
32
|
export const text2hash = (input) => {
|
|
33
33
|
return crypto.createHash("sha256").update(input).digest("hex");
|
|
34
34
|
};
|
|
35
|
+
export const localizedText = (beat, multiLingualData, lang) => {
|
|
36
|
+
if (lang &&
|
|
37
|
+
multiLingualData &&
|
|
38
|
+
multiLingualData?.multiLingualTexts &&
|
|
39
|
+
multiLingualData?.multiLingualTexts[lang] &&
|
|
40
|
+
multiLingualData?.multiLingualTexts[lang].text) {
|
|
41
|
+
return multiLingualData?.multiLingualTexts[lang].text;
|
|
42
|
+
}
|
|
43
|
+
return beat.text;
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "lib/cli/
|
|
6
|
+
"main": "lib/cli/bin.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"mulmo": "lib/cli/
|
|
9
|
-
"mulmo-tool": "lib/cli/tool-cli.js"
|
|
8
|
+
"mulmo": "lib/cli/bin.js"
|
|
10
9
|
},
|
|
11
10
|
"files": [
|
|
12
11
|
"./lib",
|
|
13
12
|
"./assets/music/StarsBeyondEx.mp3",
|
|
14
13
|
"./assets/audio/silent300.mp3",
|
|
15
14
|
"./assets/audio/silent800.mp3",
|
|
15
|
+
"./assets/audio/silent60sec.mp3",
|
|
16
16
|
"./assets/html/",
|
|
17
17
|
"./assets/font/",
|
|
18
18
|
"./assets/templates/"
|
|
@@ -23,20 +23,22 @@
|
|
|
23
23
|
"test": "tests"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"audio": "npx tsx ./src/cli/
|
|
27
|
-
"translate": "npx tsx ./src/cli/
|
|
28
|
-
"movie": "npx tsx ./src/cli/
|
|
29
|
-
"images": "npx tsx ./src/cli/
|
|
30
|
-
"preprocess": "npx tsx ./src/cli/
|
|
26
|
+
"audio": "npx tsx ./src/cli/bin.ts audio",
|
|
27
|
+
"translate": "npx tsx ./src/cli/bin.ts translate",
|
|
28
|
+
"movie": "npx tsx ./src/cli/bin.ts movie",
|
|
29
|
+
"images": "npx tsx ./src/cli/bin.ts images",
|
|
30
|
+
"preprocess": "npx tsx ./src/cli/bin.ts preprocess",
|
|
31
|
+
"pdf": "npx tsx ./src/cli/bin.ts pdf",
|
|
31
32
|
"test": "rm -f scratchpad/test*.* && npx tsx ./src/audio.ts scripts/test/test.json && npx tsx ./src/images.ts scripts/test/test.json && npx tsx ./src/movie.ts scripts/test/test.json",
|
|
32
33
|
"ci_test": "tsx --test ./test/*/test_*.ts",
|
|
33
34
|
"lint": "eslint src test",
|
|
34
35
|
"build": "tsc",
|
|
35
36
|
"build_test": "tsc && git checkout -- lib/*",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
37
|
+
"cli": "npx tsx ./src/cli/bin.ts",
|
|
38
|
+
"scripting": "npx tsx ./src/cli/bin.ts tool scripting",
|
|
39
|
+
"prompt": "npx tsx ./src/cli/bin.ts tool prompt",
|
|
40
|
+
"schema": "npx tsx ./src/cli/bin.ts tool schema",
|
|
41
|
+
"story_to_script": "npx tsx ./src/cli/bin.ts tool story_to_script",
|
|
40
42
|
"latest": "yarn upgrade-interactive --latest",
|
|
41
43
|
"format": "prettier --write '{src,scripts,assets/templates,draft,ideason,scripts_mag2,proto,test,graphai,output,docs/scripts}/**/*.{ts,json,yaml}'"
|
|
42
44
|
},
|
|
@@ -48,43 +50,45 @@
|
|
|
48
50
|
},
|
|
49
51
|
"homepage": "https://github.com/receptron/mulmocast-cli#readme",
|
|
50
52
|
"dependencies": {
|
|
51
|
-
"@
|
|
53
|
+
"@google-cloud/text-to-speech": "^6.1.0",
|
|
52
54
|
"@graphai/anthropic_agent": "^2.0.0",
|
|
53
55
|
"@graphai/browserless_agent": "^2.0.0",
|
|
54
56
|
"@graphai/gemini_agent": "^1.0.1",
|
|
55
57
|
"@graphai/groq_agent": "^1.0.1",
|
|
56
58
|
"@graphai/input_agents": "^1.0.1",
|
|
57
|
-
"@graphai/openai_agent": "^
|
|
58
|
-
"@graphai/
|
|
59
|
+
"@graphai/openai_agent": "^2.0.0",
|
|
60
|
+
"@graphai/stream_agent_filter": "^2.0.1",
|
|
61
|
+
"@graphai/vanilla": "^2.0.2",
|
|
59
62
|
"@graphai/vanilla_node_agents": "^2.0.0",
|
|
60
63
|
"@pdf-lib/fontkit": "^1.1.1",
|
|
61
|
-
"@types/fluent-ffmpeg": "^2.1.26",
|
|
62
64
|
"canvas": "^3.1.0",
|
|
65
|
+
"clipboardy": "^4.0.0",
|
|
63
66
|
"dotenv": "^16.4.7",
|
|
64
67
|
"fluent-ffmpeg": "^2.1.3",
|
|
65
68
|
"google-auth-library": "^9.15.1",
|
|
66
|
-
"graphai": "^1.0.
|
|
67
|
-
"inquirer": "^12.6.
|
|
69
|
+
"graphai": "^1.0.14",
|
|
70
|
+
"inquirer": "^12.6.1",
|
|
68
71
|
"marked": "^15.0.11",
|
|
69
72
|
"ora": "^8.2.0",
|
|
70
73
|
"pdf-lib": "^1.17.1",
|
|
71
74
|
"puppeteer": "^24.8.1",
|
|
72
|
-
"yaml": "^2.
|
|
75
|
+
"yaml": "^2.8.0",
|
|
73
76
|
"yargs": "^17.7.2",
|
|
74
77
|
"zod": "^3.24.4",
|
|
75
78
|
"zod-to-json-schema": "^3.24.5"
|
|
76
79
|
},
|
|
77
80
|
"devDependencies": {
|
|
78
81
|
"@receptron/test_utils": "^2.0.0",
|
|
82
|
+
"@types/fluent-ffmpeg": "^2.1.26",
|
|
79
83
|
"@types/yargs": "^17.0.33",
|
|
80
|
-
"eslint": "^9.
|
|
81
|
-
"eslint-config-prettier": "^10.
|
|
84
|
+
"eslint": "^9.27.0",
|
|
85
|
+
"eslint-config-prettier": "^10.1.5",
|
|
82
86
|
"eslint-plugin-prettier": "^5.4.0",
|
|
83
87
|
"prettier": "^3.3.3",
|
|
84
88
|
"ts-node": "^10.9.2",
|
|
85
89
|
"tsx": "^4.19.4",
|
|
86
90
|
"typescript": "^5.7.3",
|
|
87
|
-
"typescript-eslint": "^8.32.
|
|
91
|
+
"typescript-eslint": "^8.32.1"
|
|
88
92
|
},
|
|
89
93
|
"engines": {
|
|
90
94
|
"node": ">=16.0.0"
|