mulmocast 2.1.28 ā 2.1.29
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/cli/commands/tool/index.js +11 -1
- package/lib/cli/commands/tool/info/builder.d.ts +6 -0
- package/lib/cli/commands/tool/info/builder.js +13 -0
- package/lib/cli/commands/tool/info/handler.d.ts +6 -0
- package/lib/cli/commands/tool/info/handler.js +219 -0
- package/lib/cli/commands/tool/info/index.d.ts +4 -0
- package/lib/cli/commands/tool/info/index.js +4 -0
- package/lib/data/index.d.ts +1 -0
- package/lib/data/index.js +1 -0
- package/lib/data/markdownStyles.d.ts +14 -0
- package/lib/data/markdownStyles.js +998 -0
- package/lib/types/schema.d.ts +5 -0
- package/lib/types/schema.js +1 -0
- package/lib/utils/context.d.ts +2 -0
- package/lib/utils/html_render.js +2 -2
- package/lib/utils/image_plugins/markdown.js +6 -1
- package/package.json +1 -1
- package/scripts/test/test_all_markdown_styles.json +809 -0
- package/scripts/test/test_markdown_styles.json +53 -0
|
@@ -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
|
|
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,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,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
|
+
};
|
package/lib/data/index.d.ts
CHANGED
package/lib/data/index.js
CHANGED
|
@@ -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[];
|