mulmocast 2.1.28 → 2.1.30

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.
Files changed (38) hide show
  1. package/README.md +77 -0
  2. package/assets/html/tailwind.html +33 -0
  3. package/lib/cli/commands/tool/index.js +11 -1
  4. package/lib/cli/commands/tool/info/builder.d.ts +6 -0
  5. package/lib/cli/commands/tool/info/builder.js +13 -0
  6. package/lib/cli/commands/tool/info/handler.d.ts +6 -0
  7. package/lib/cli/commands/tool/info/handler.js +219 -0
  8. package/lib/cli/commands/tool/info/index.d.ts +4 -0
  9. package/lib/cli/commands/tool/info/index.js +4 -0
  10. package/lib/data/index.d.ts +1 -0
  11. package/lib/data/index.js +1 -0
  12. package/lib/data/markdownStyles.d.ts +14 -0
  13. package/lib/data/markdownStyles.js +998 -0
  14. package/lib/types/schema.d.ts +72 -5
  15. package/lib/types/schema.js +22 -1
  16. package/lib/types/type.d.ts +4 -1
  17. package/lib/utils/context.d.ts +24 -2
  18. package/lib/utils/html_render.js +13 -5
  19. package/lib/utils/image_plugins/chart.js +2 -5
  20. package/lib/utils/image_plugins/markdown.js +60 -12
  21. package/lib/utils/image_plugins/markdown_layout.d.ts +6 -0
  22. package/lib/utils/image_plugins/markdown_layout.js +127 -0
  23. package/lib/utils/image_plugins/mermaid.d.ts +1 -0
  24. package/lib/utils/image_plugins/mermaid.js +16 -13
  25. package/lib/utils/image_plugins/text_slide.js +3 -2
  26. package/lib/utils/image_plugins/utils.d.ts +2 -0
  27. package/lib/utils/image_plugins/utils.js +13 -0
  28. package/package.json +1 -1
  29. package/scripts/test/test_all_markdown_styles.json +809 -0
  30. package/scripts/test/test_markdown_layout.json +152 -0
  31. package/scripts/test/test_markdown_mermaid.json +58 -0
  32. package/scripts/test/test_markdown_styles.json +53 -0
  33. package/scripts/test/test_text_slide_style.json +70 -0
  34. package/scripts/test/test_vertexai.json +4 -1
  35. package/scripts/test/test_vertexai.json~ +21 -0
  36. package/scripts/test/zenn_combined_example.json +39 -0
  37. package/scripts/test/zenn_layout_samples.json +92 -0
  38. package/scripts/test/zenn_markdown_demo.json +79 -0
package/README.md CHANGED
@@ -343,6 +343,50 @@ To force regeneration, delete the old files — including temporary files — un
343
343
 
344
344
  If you modify the text or instruction fields in a MulmoScript, mulmo will automatically detect the changes and regenerate the corresponding audio content upon re-run.
345
345
 
346
+ ## Markdown Slide Styles
347
+
348
+ MulmoCast includes 100 pre-designed CSS styles for markdown slides, organized in 10 categories:
349
+
350
+ | Category | Description | Example Styles |
351
+ |----------|-------------|----------------|
352
+ | business | Professional corporate designs | corporate-blue, executive-gray, finance-green |
353
+ | tech | Technology and developer themes | cyber-neon, matrix-green, terminal-dark |
354
+ | creative | Artistic and expressive styles | artistic-splash, watercolor-soft, graffiti |
355
+ | minimalist | Clean and simple designs | clean-white, zen-beige, nordic-light |
356
+ | nature | Nature-inspired themes | forest-green, ocean-blue, sunset-orange |
357
+ | dark | Dark mode and elegant themes | charcoal-elegant, midnight-blue, obsidian |
358
+ | colorful | Vibrant and bold colors | vibrant-pink, candy-colors, aurora |
359
+ | vintage | Retro and classic styles | retro-70s, art-deco, typewriter |
360
+ | japanese | Japanese aesthetic designs | washi-paper, sakura-pink, zen-garden |
361
+ | geometric | Pattern-based designs | hexagon-pattern, isometric, bauhaus |
362
+
363
+ ### Usage
364
+
365
+ Add the `style` property to a markdown beat:
366
+
367
+ ```json
368
+ {
369
+ "beats": [
370
+ {
371
+ "text": "Corporate presentation slide",
372
+ "image": {
373
+ "type": "markdown",
374
+ "markdown": "# Quarterly Report\n\n## Key Highlights\n\n- Revenue up 15%\n- New market expansion\n- Team growth",
375
+ "style": "corporate-blue"
376
+ }
377
+ }
378
+ ]
379
+ }
380
+ ```
381
+
382
+ ### Discover Available Styles
383
+
384
+ Use the `mulmo tool info` command to see all available styles:
385
+
386
+ ```bash
387
+ mulmo tool info styles
388
+ ```
389
+
346
390
  ## MulmoScript Format
347
391
 
348
392
  MulmoScript is a JSON format to define podcast or video scripts:
@@ -569,6 +613,7 @@ Commands:
569
613
  mulmo tool complete <file> Complete partial MulmoScript with defaults
570
614
  mulmo tool prompt Dump prompt from template
571
615
  mulmo tool schema Dump mulmocast schema
616
+ mulmo tool info [category] Show available options (styles, bgm, voices, etc.)
572
617
 
573
618
  Options:
574
619
  --version Show version number [boolean]
@@ -686,6 +731,38 @@ Examples:
686
731
  mulmo tool complete input.json -t children_book
687
732
  ```
688
733
 
734
+ ```
735
+ mulmo tool info [category]
736
+
737
+ Show available options for MulmoScript configuration
738
+
739
+ Positionals:
740
+ category Category to show info for
741
+ [string] [choices: "styles", "bgm", "templates", "voices", "images", "movies", "llm"]
742
+
743
+ Options:
744
+ --version Show version number [boolean]
745
+ -v, --verbose verbose log [boolean] [required] [default: false]
746
+ -h, --help Show help [boolean]
747
+ -F, --format Output format [string] [choices: "text", "json", "yaml"]
748
+
749
+ Examples:
750
+ # Show all available categories
751
+ mulmo tool info
752
+
753
+ # List all 100 markdown styles
754
+ mulmo tool info styles
755
+
756
+ # List available BGM assets
757
+ mulmo tool info bgm
758
+
759
+ # List TTS providers and voices
760
+ mulmo tool info voices
761
+
762
+ # Output as JSON for programmatic use
763
+ mulmo tool info styles --format json
764
+ ```
765
+
689
766
 
690
767
 
691
768
  ## Contributing
@@ -7,6 +7,39 @@
7
7
  <title>${title}</title>
8
8
  <!-- Tailwind CSS CDN -->
9
9
  <script src="https://cdn.tailwindcss.com"></script>
10
+ <!-- Mermaid CDN for embedded diagrams -->
11
+ <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
12
+ <script>
13
+ mermaid.initialize({
14
+ startOnLoad: true,
15
+ theme: 'default',
16
+ flowchart: { useMaxWidth: true }
17
+ });
18
+ document.addEventListener("DOMContentLoaded", () => {
19
+ const mermaidElements = document.querySelectorAll(".mermaid");
20
+ if (mermaidElements.length > 0) {
21
+ mermaid.init(undefined, ".mermaid");
22
+ mermaidElements.forEach(el => el.dataset.ready = "true");
23
+ }
24
+ });
25
+ </script>
26
+ <style>
27
+ /* Mermaid diagram styling */
28
+ .mermaid {
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ width: 100%;
33
+ min-height: 100px;
34
+ }
35
+ .mermaid svg {
36
+ max-width: 100%;
37
+ max-height: 100%;
38
+ width: auto;
39
+ height: auto;
40
+ }
41
+ ${custom_style}
42
+ </style>
10
43
  </head>
11
44
  <body class="bg-white text-gray-800 h-full flex flex-col">
12
45
  ${html_body}
@@ -4,7 +4,17 @@ import * as schemaCmd from "./schema/index.js";
4
4
  import * as storyToScriptCmd from "./story_to_script/index.js";
5
5
  import * as whisperCmd from "./whisper/index.js";
6
6
  import * as completeCmd from "./complete/index.js";
7
+ import * as infoCmd from "./info/index.js";
7
8
  export const command = "tool <command>";
8
9
  export const desc = "Generate Mulmo script and other tools";
9
- export const builder = (y) => y.command(scriptingCmd).command(promptCmd).command(schemaCmd).command(storyToScriptCmd).command(whisperCmd).command(completeCmd).demandCommand().strict();
10
+ export const builder = (y) => y
11
+ .command(scriptingCmd)
12
+ .command(promptCmd)
13
+ .command(schemaCmd)
14
+ .command(storyToScriptCmd)
15
+ .command(whisperCmd)
16
+ .command(completeCmd)
17
+ .command(infoCmd)
18
+ .demandCommand()
19
+ .strict();
10
20
  export const handler = (__argv) => { };
@@ -0,0 +1,6 @@
1
+ import { Argv } from "yargs";
2
+ export declare const builder: (yargs: Argv) => Argv<{
3
+ category: string | undefined;
4
+ } & {
5
+ format: string;
6
+ }>;
@@ -0,0 +1,13 @@
1
+ export const builder = (yargs) => yargs
2
+ .positional("category", {
3
+ describe: "Category to show info for",
4
+ type: "string",
5
+ choices: ["styles", "bgm", "templates", "voices", "images", "movies", "llm"],
6
+ })
7
+ .option("format", {
8
+ alias: "F",
9
+ describe: "Output format",
10
+ type: "string",
11
+ choices: ["text", "json", "yaml"],
12
+ default: "text",
13
+ });
@@ -0,0 +1,6 @@
1
+ interface InfoCliArgs {
2
+ category?: string;
3
+ format: string;
4
+ }
5
+ export declare const handler: (argv: InfoCliArgs) => void;
6
+ export {};
@@ -0,0 +1,219 @@
1
+ /* eslint-disable no-console */
2
+ import { getMarkdownStyleNames, getMarkdownCategories, getMarkdownStylesByCategory } from "../../../../data/markdownStyles.js";
3
+ import { bgmAssets } from "../../../../data/bgmAssets.js";
4
+ import { templateDataSet } from "../../../../data/templateDataSet.js";
5
+ import { provider2TTSAgent, provider2ImageAgent, provider2MovieAgent, provider2LLMAgent } from "../../../../types/provider2agent.js";
6
+ import YAML from "yaml";
7
+ const formatOutput = (data, format) => {
8
+ if (format === "json") {
9
+ return JSON.stringify(data, null, 2);
10
+ }
11
+ else if (format === "yaml") {
12
+ return YAML.stringify(data);
13
+ }
14
+ return "";
15
+ };
16
+ const getStylesInfo = () => {
17
+ const categories = getMarkdownCategories();
18
+ const result = {};
19
+ for (const category of categories) {
20
+ result[category] = getMarkdownStylesByCategory(category).map((s) => s.name);
21
+ }
22
+ return { styles: result, total: getMarkdownStyleNames().length };
23
+ };
24
+ const getBgmInfo = () => {
25
+ return {
26
+ license: bgmAssets.license,
27
+ bgms: bgmAssets.bgms.map((b) => ({
28
+ name: b.name,
29
+ title: b.title,
30
+ duration: b.duration,
31
+ prompt: b.prompt,
32
+ })),
33
+ };
34
+ };
35
+ const getTemplatesInfo = () => {
36
+ return {
37
+ templates: Object.keys(templateDataSet),
38
+ };
39
+ };
40
+ const getVoicesInfo = () => {
41
+ const result = {};
42
+ for (const [provider, config] of Object.entries(provider2TTSAgent)) {
43
+ result[provider] = {
44
+ defaultVoice: config.defaultVoice,
45
+ defaultModel: config.defaultModel,
46
+ models: config.models,
47
+ };
48
+ }
49
+ return { ttsProviders: result };
50
+ };
51
+ const getImagesInfo = () => {
52
+ const result = {};
53
+ for (const [provider, config] of Object.entries(provider2ImageAgent)) {
54
+ result[provider] = {
55
+ defaultModel: config.defaultModel,
56
+ models: config.models,
57
+ };
58
+ }
59
+ return { imageProviders: result };
60
+ };
61
+ const getMoviesInfo = () => {
62
+ const result = {};
63
+ for (const [provider, config] of Object.entries(provider2MovieAgent)) {
64
+ result[provider] = {
65
+ defaultModel: config.defaultModel,
66
+ models: config.models,
67
+ };
68
+ }
69
+ return { movieProviders: result };
70
+ };
71
+ const getLlmInfo = () => {
72
+ const result = {};
73
+ for (const [provider, config] of Object.entries(provider2LLMAgent)) {
74
+ result[provider] = {
75
+ defaultModel: config.defaultModel,
76
+ models: config.models,
77
+ };
78
+ }
79
+ return { llmProviders: result };
80
+ };
81
+ const printStylesText = () => {
82
+ const categories = getMarkdownCategories();
83
+ console.log("\n📎 Markdown Styles (100 styles in 10 categories)\n");
84
+ console.log("Usage: Set 'style' property in markdown image beat");
85
+ console.log('Example: { "type": "markdown", "markdown": "# Title", "style": "corporate-blue" }\n');
86
+ for (const category of categories) {
87
+ const styles = getMarkdownStylesByCategory(category);
88
+ console.log(` ${category.toUpperCase()} (${styles.length} styles)`);
89
+ console.log(` ${styles.map((s) => s.name).join(", ")}\n`);
90
+ }
91
+ };
92
+ const printBgmText = () => {
93
+ console.log("\n🎵 BGM Assets\n");
94
+ console.log("Usage: Set 'audioParams.bgm' in your script");
95
+ console.log('Example: { "audioParams": { "bgm": { "kind": "url", "url": "..." } } }\n');
96
+ console.log(` License: ${bgmAssets.license}\n`);
97
+ for (const bgm of bgmAssets.bgms) {
98
+ console.log(` ${bgm.name}`);
99
+ console.log(` Title: ${bgm.title}`);
100
+ console.log(` Duration: ${bgm.duration}`);
101
+ console.log(` Prompt: ${bgm.prompt}`);
102
+ console.log(` URL: ${bgm.url}\n`);
103
+ }
104
+ };
105
+ const printTemplatesText = () => {
106
+ const templates = Object.keys(templateDataSet);
107
+ console.log("\n📝 Script Templates\n");
108
+ console.log("Usage: Select template in 'mulmo tool scripting'\n");
109
+ console.log(` Available templates (${templates.length}):\n`);
110
+ for (const template of templates) {
111
+ console.log(` - ${template}`);
112
+ }
113
+ console.log("");
114
+ };
115
+ const printVoicesText = () => {
116
+ console.log("\n🎤 TTS (Text-to-Speech) Providers\n");
117
+ console.log("Usage: Set 'speechParams.speakers' in your script");
118
+ console.log('Example: { "speechParams": { "speakers": { "Presenter": { "provider": "openai", "voiceId": "shimmer" } } } }\n');
119
+ for (const [provider, config] of Object.entries(provider2TTSAgent)) {
120
+ const cfg = config;
121
+ console.log(` ${provider.toUpperCase()}`);
122
+ if (cfg.defaultVoice)
123
+ console.log(` Default voice: ${cfg.defaultVoice}`);
124
+ if (cfg.defaultModel)
125
+ console.log(` Default model: ${cfg.defaultModel}`);
126
+ if (cfg.models)
127
+ console.log(` Models: ${cfg.models.join(", ")}`);
128
+ console.log("");
129
+ }
130
+ };
131
+ const printImagesText = () => {
132
+ console.log("\n🖼️ Image Generation Providers\n");
133
+ console.log("Usage: Set 'imageParams.provider' and 'imageParams.model' in your script\n");
134
+ for (const [provider, config] of Object.entries(provider2ImageAgent)) {
135
+ console.log(` ${provider.toUpperCase()}`);
136
+ console.log(` Default model: ${config.defaultModel}`);
137
+ console.log(` Models: ${config.models.join(", ")}\n`);
138
+ }
139
+ };
140
+ const printMoviesText = () => {
141
+ console.log("\n🎬 Movie Generation Providers\n");
142
+ console.log("Usage: Set 'movieParams.provider' and 'movieParams.model' in your script\n");
143
+ for (const [provider, config] of Object.entries(provider2MovieAgent)) {
144
+ console.log(` ${provider.toUpperCase()}`);
145
+ console.log(` Default model: ${config.defaultModel}`);
146
+ console.log(` Models: ${config.models.join(", ")}\n`);
147
+ }
148
+ };
149
+ const printLlmText = () => {
150
+ console.log("\n🤖 LLM Providers\n");
151
+ console.log("Usage: Set 'htmlImageParams.provider' in your script\n");
152
+ for (const [provider, config] of Object.entries(provider2LLMAgent)) {
153
+ console.log(` ${provider.toUpperCase()}`);
154
+ console.log(` Default model: ${config.defaultModel}`);
155
+ console.log(` Models: ${config.models.join(", ")}\n`);
156
+ }
157
+ };
158
+ const printAllCategories = () => {
159
+ console.log("\n📚 Available Info Categories\n");
160
+ console.log(" Usage: mulmo tool info <category> [--format json|yaml]\n");
161
+ console.log(" Categories:");
162
+ console.log(" styles - Markdown slide styles (100 styles in 10 categories)");
163
+ console.log(" bgm - Background music assets");
164
+ console.log(" templates - Script templates for 'mulmo tool scripting'");
165
+ console.log(" voices - TTS providers and voice options");
166
+ console.log(" images - Image generation providers and models");
167
+ console.log(" movies - Movie generation providers and models");
168
+ console.log(" llm - LLM providers and models\n");
169
+ };
170
+ const validCategories = ["styles", "bgm", "templates", "voices", "images", "movies", "llm"];
171
+ const isValidCategory = (category) => {
172
+ return validCategories.includes(category);
173
+ };
174
+ export const handler = (argv) => {
175
+ const { category, format = "text" } = argv;
176
+ if (!category) {
177
+ if (format === "text") {
178
+ printAllCategories();
179
+ }
180
+ else {
181
+ const allData = {
182
+ categories: validCategories,
183
+ description: "Use 'mulmo tool info <category>' for detailed information",
184
+ };
185
+ console.log(formatOutput(allData, format));
186
+ }
187
+ return;
188
+ }
189
+ if (!isValidCategory(category)) {
190
+ console.error(`Invalid category: ${category}`);
191
+ console.error(`Valid categories: ${validCategories.join(", ")}`);
192
+ process.exit(1);
193
+ }
194
+ const dataGetters = {
195
+ styles: getStylesInfo,
196
+ bgm: getBgmInfo,
197
+ templates: getTemplatesInfo,
198
+ voices: getVoicesInfo,
199
+ images: getImagesInfo,
200
+ movies: getMoviesInfo,
201
+ llm: getLlmInfo,
202
+ };
203
+ const textPrinters = {
204
+ styles: printStylesText,
205
+ bgm: printBgmText,
206
+ templates: printTemplatesText,
207
+ voices: printVoicesText,
208
+ images: printImagesText,
209
+ movies: printMoviesText,
210
+ llm: printLlmText,
211
+ };
212
+ if (format === "text") {
213
+ textPrinters[category]();
214
+ }
215
+ else {
216
+ const data = dataGetters[category]();
217
+ console.log(formatOutput(data, format));
218
+ }
219
+ };
@@ -0,0 +1,4 @@
1
+ export declare const command = "info [category]";
2
+ export declare const desc = "Show available options (styles, bgm, templates, voices, images, movies, llm)";
3
+ export { builder } from "./builder.js";
4
+ export { handler } from "./handler.js";
@@ -0,0 +1,4 @@
1
+ export const command = "info [category]";
2
+ export const desc = "Show available options (styles, bgm, templates, voices, images, movies, llm)";
3
+ export { builder } from "./builder.js";
4
+ export { handler } from "./handler.js";
@@ -2,3 +2,4 @@ export * from "./promptTemplates.js";
2
2
  export * from "./scriptTemplates.js";
3
3
  export * from "./templateDataSet.js";
4
4
  export * from "./bgmAssets.js";
5
+ export * from "./markdownStyles.js";
package/lib/data/index.js CHANGED
@@ -2,3 +2,4 @@ export * from "./promptTemplates.js";
2
2
  export * from "./scriptTemplates.js";
3
3
  export * from "./templateDataSet.js";
4
4
  export * from "./bgmAssets.js";
5
+ export * from "./markdownStyles.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Markdown Slide Styles
3
+ * 100 pre-designed styles for markdown slides
4
+ */
5
+ export interface MarkdownStyle {
6
+ name: string;
7
+ category: string;
8
+ css: string;
9
+ }
10
+ export declare const markdownStyles: MarkdownStyle[];
11
+ export declare const getMarkdownStyle: (styleName: string) => MarkdownStyle | undefined;
12
+ export declare const getMarkdownStyleNames: () => string[];
13
+ export declare const getMarkdownStylesByCategory: (category: string) => MarkdownStyle[];
14
+ export declare const getMarkdownCategories: () => string[];