mulmocast 2.9.2 → 2.10.0

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 (161) hide show
  1. package/lib/cli/bin.js +0 -0
  2. package/lib/index.browser.d.ts +7 -0
  3. package/lib/index.browser.js +6 -0
  4. package/lib/types/const.d.ts +7 -0
  5. package/lib/types/const.js +7 -0
  6. package/lib/types/schema.js +6 -2
  7. package/lib/utils/beat_html/chart.d.ts +15 -0
  8. package/lib/utils/beat_html/chart.js +21 -0
  9. package/lib/utils/beat_html/html_tailwind.d.ts +19 -0
  10. package/lib/utils/beat_html/html_tailwind.js +20 -0
  11. package/lib/utils/beat_html/index.d.ts +33 -0
  12. package/lib/utils/beat_html/index.js +65 -0
  13. package/lib/utils/beat_html/markdown.d.ts +20 -0
  14. package/lib/utils/beat_html/markdown.js +25 -0
  15. package/lib/utils/beat_html/media.d.ts +14 -0
  16. package/lib/utils/beat_html/media.js +19 -0
  17. package/lib/utils/beat_html/mermaid.d.ts +14 -0
  18. package/lib/utils/beat_html/mermaid.js +22 -0
  19. package/lib/utils/beat_html/slide.d.ts +21 -0
  20. package/lib/utils/beat_html/slide.js +33 -0
  21. package/lib/utils/beat_html/text_slide.d.ts +17 -0
  22. package/lib/utils/beat_html/text_slide.js +24 -0
  23. package/lib/utils/beat_html/type.d.ts +73 -0
  24. package/lib/utils/element_id.d.ts +26 -0
  25. package/lib/utils/element_id.js +31 -0
  26. package/lib/utils/html_escape.d.ts +14 -0
  27. package/lib/utils/html_escape.js +30 -0
  28. package/lib/utils/image_plugins/bg_image_util.js +2 -1
  29. package/lib/utils/image_plugins/chart.js +6 -30
  30. package/lib/utils/image_plugins/chart_html.d.ts +24 -0
  31. package/lib/utils/image_plugins/chart_html.js +81 -0
  32. package/lib/utils/image_plugins/html_tailwind.js +2 -5
  33. package/lib/utils/image_plugins/html_tailwind_markup.d.ts +21 -0
  34. package/lib/utils/image_plugins/html_tailwind_markup.js +8 -0
  35. package/lib/utils/image_plugins/markdown.js +41 -30
  36. package/lib/utils/image_plugins/markdown_layout.d.ts +46 -4
  37. package/lib/utils/image_plugins/markdown_layout.js +96 -83
  38. package/lib/utils/image_plugins/media_html.d.ts +16 -0
  39. package/lib/utils/image_plugins/media_html.js +39 -0
  40. package/lib/utils/image_plugins/mermaid.d.ts +1 -0
  41. package/lib/utils/image_plugins/mermaid.js +4 -16
  42. package/lib/utils/image_plugins/mermaid_html.d.ts +22 -0
  43. package/lib/utils/image_plugins/mermaid_html.js +36 -0
  44. package/lib/utils/image_plugins/movie.js +2 -15
  45. package/lib/utils/sdk_timeout.d.ts +3 -0
  46. package/lib/utils/sdk_timeout.js +7 -0
  47. package/lib/utils/swipe_to_html.d.ts +18 -0
  48. package/lib/utils/swipe_to_html.js +26 -2
  49. package/package.json +11 -10
  50. package/scripts/test/test_captions_2.json~ +278 -0
  51. package/scripts/test/test_en_portrait.json~ +31 -0
  52. package/scripts/test/test_slide_image_ref_gemini_en.json~ +289 -0
  53. package/scripts/test/test_vertexai.json~ +21 -0
  54. package/lib/agents/image_google_agent.d.ts +0 -5
  55. package/lib/agents/image_google_agent.js +0 -86
  56. package/lib/agents/movie_google_agent.d.ts +0 -9
  57. package/lib/agents/movie_google_agent.js +0 -122
  58. package/lib/agents/mulmo_prompts_agent.d.ts +0 -7
  59. package/lib/agents/mulmo_prompts_agent.js +0 -37
  60. package/lib/agents/prompts_data.d.ts +0 -15
  61. package/lib/agents/prompts_data.js +0 -16
  62. package/lib/agents/tts_nijivoice_agent.d.ts +0 -5
  63. package/lib/agents/tts_nijivoice_agent.js +0 -69
  64. package/lib/agents/validate_mulmo_script_agent.d.ts +0 -17
  65. package/lib/agents/validate_mulmo_script_agent.js +0 -34
  66. package/lib/cli/args.d.ts +0 -15
  67. package/lib/cli/args.js +0 -62
  68. package/lib/cli/cli.d.ts +0 -17
  69. package/lib/cli/cli.js +0 -117
  70. package/lib/cli/run.d.ts +0 -2
  71. package/lib/cli/run.js +0 -3
  72. package/lib/cli/tool-args.d.ts +0 -16
  73. package/lib/cli/tool-args.js +0 -64
  74. package/lib/cli/tool-cli.d.ts +0 -2
  75. package/lib/cli/tool-cli.js +0 -32
  76. package/lib/cli/tool_commands/prompt/builder.d.ts +0 -4
  77. package/lib/cli/tool_commands/prompt/builder.js +0 -11
  78. package/lib/cli/tool_commands/prompt/handler.d.ts +0 -4
  79. package/lib/cli/tool_commands/prompt/handler.js +0 -14
  80. package/lib/cli/tool_commands/prompt/index.d.ts +0 -4
  81. package/lib/cli/tool_commands/prompt/index.js +0 -4
  82. package/lib/cli/tool_commands/schema/builder.d.ts +0 -2
  83. package/lib/cli/tool_commands/schema/builder.js +0 -3
  84. package/lib/cli/tool_commands/schema/handler.d.ts +0 -2
  85. package/lib/cli/tool_commands/schema/handler.js +0 -12
  86. package/lib/cli/tool_commands/schema/index.d.ts +0 -4
  87. package/lib/cli/tool_commands/schema/index.js +0 -4
  88. package/lib/cli/tool_commands/scripting/builder.d.ts +0 -20
  89. package/lib/cli/tool_commands/scripting/builder.js +0 -63
  90. package/lib/cli/tool_commands/scripting/handler.d.ts +0 -12
  91. package/lib/cli/tool_commands/scripting/handler.js +0 -36
  92. package/lib/cli/tool_commands/scripting/index.d.ts +0 -4
  93. package/lib/cli/tool_commands/scripting/index.js +0 -4
  94. package/lib/index.d.ts +0 -8
  95. package/lib/index.js +0 -8
  96. package/lib/methods/mulmo_script_template.d.ts +0 -4
  97. package/lib/methods/mulmo_script_template.js +0 -6
  98. package/lib/methods/mulmo_studio.d.ts +0 -8
  99. package/lib/methods/mulmo_studio.js +0 -25
  100. package/lib/slide/blocks.d.ts +0 -13
  101. package/lib/slide/blocks.js +0 -251
  102. package/lib/slide/index.d.ts +0 -6
  103. package/lib/slide/index.js +0 -7
  104. package/lib/slide/layouts/big_quote.d.ts +0 -2
  105. package/lib/slide/layouts/big_quote.js +0 -19
  106. package/lib/slide/layouts/columns.d.ts +0 -2
  107. package/lib/slide/layouts/columns.js +0 -53
  108. package/lib/slide/layouts/comparison.d.ts +0 -2
  109. package/lib/slide/layouts/comparison.js +0 -25
  110. package/lib/slide/layouts/funnel.d.ts +0 -2
  111. package/lib/slide/layouts/funnel.js +0 -25
  112. package/lib/slide/layouts/grid.d.ts +0 -2
  113. package/lib/slide/layouts/grid.js +0 -38
  114. package/lib/slide/layouts/index.d.ts +0 -3
  115. package/lib/slide/layouts/index.js +0 -46
  116. package/lib/slide/layouts/matrix.d.ts +0 -2
  117. package/lib/slide/layouts/matrix.js +0 -53
  118. package/lib/slide/layouts/split.d.ts +0 -2
  119. package/lib/slide/layouts/split.js +0 -51
  120. package/lib/slide/layouts/stats.d.ts +0 -2
  121. package/lib/slide/layouts/stats.js +0 -23
  122. package/lib/slide/layouts/table.d.ts +0 -2
  123. package/lib/slide/layouts/table.js +0 -10
  124. package/lib/slide/layouts/timeline.d.ts +0 -2
  125. package/lib/slide/layouts/timeline.js +0 -27
  126. package/lib/slide/layouts/title.d.ts +0 -2
  127. package/lib/slide/layouts/title.js +0 -19
  128. package/lib/slide/layouts/waterfall.d.ts +0 -2
  129. package/lib/slide/layouts/waterfall.js +0 -63
  130. package/lib/slide/render.d.ts +0 -17
  131. package/lib/slide/render.js +0 -101
  132. package/lib/slide/schema.d.ts +0 -9309
  133. package/lib/slide/schema.js +0 -434
  134. package/lib/slide/utils.d.ts +0 -76
  135. package/lib/slide/utils.js +0 -243
  136. package/lib/tools/prompt.js +0 -18
  137. package/lib/tools/seed.d.ts +0 -3
  138. package/lib/tools/seed.js +0 -211
  139. package/lib/tools/seed_from_url.d.ts +0 -3
  140. package/lib/tools/seed_from_url.js +0 -188
  141. package/lib/types/slide.d.ts +0 -9309
  142. package/lib/types/slide.js +0 -434
  143. package/lib/utils/assets.d.ts +0 -18
  144. package/lib/utils/assets.js +0 -101
  145. package/lib/utils/cli.d.ts +0 -1
  146. package/lib/utils/cli.js +0 -15
  147. package/lib/utils/const.d.ts +0 -12
  148. package/lib/utils/const.js +0 -12
  149. package/lib/utils/image_preprocess.d.ts +0 -14
  150. package/lib/utils/image_preprocess.js +0 -52
  151. package/lib/utils/markdown.d.ts +0 -3
  152. package/lib/utils/markdown.js +0 -42
  153. package/lib/utils/pdf.d.ts +0 -9
  154. package/lib/utils/pdf.js +0 -77
  155. package/lib/utils/preprocess.d.ts +0 -343
  156. package/lib/utils/preprocess.js +0 -58
  157. package/lib/utils/provider2agent.d.ts +0 -141
  158. package/lib/utils/provider2agent.js +0 -267
  159. package/lib/utils/text_hash.d.ts +0 -1
  160. package/lib/utils/text_hash.js +0 -4
  161. /package/lib/{tools/prompt.d.ts → utils/beat_html/type.js} +0 -0
package/lib/cli/cli.js DELETED
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env node
2
- import "dotenv/config";
3
- import fs from "fs";
4
- import path from "path";
5
- import { GraphAILogger } from "graphai";
6
- import { getArgs } from "./args.js";
7
- import { createOrUpdateStudioData } from "../utils/preprocess.js";
8
- import { outDirName, imageDirName, audioDirName } from "../utils/const.js";
9
- import { translate, audio, images, movie, pdf, captions } from "../actions/index.js";
10
- import { getBaseDirPath, getFullPath, readMulmoScriptFile, fetchMulmoScriptFile, getOutputStudioFilePath, resolveDirPath } from "../utils/file.js";
11
- import { isHttp } from "../utils/utils.js";
12
- import clipboardy from "clipboardy";
13
- export const getFileObject = (_args) => {
14
- const { basedir, file, outdir, imagedir, audiodir } = _args;
15
- const baseDirPath = getBaseDirPath(basedir);
16
- const outDirPath = getFullPath(baseDirPath, outdir ?? outDirName);
17
- const { fileOrUrl, fileName } = (() => {
18
- if (file === "__clipboard") {
19
- // We generate a new unique script file from clipboard text in the output directory
20
- const now = new Date();
21
- const pad = (n) => n.toString().padStart(2, "0");
22
- const fileName = `script_${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
23
- const clipboardText = clipboardy.readSync();
24
- const fileOrUrl = resolveDirPath(outDirPath, `${fileName}.json`);
25
- fs.writeFileSync(fileOrUrl, clipboardText, "utf8");
26
- return { fileOrUrl, fileName };
27
- }
28
- const fileOrUrl = file ?? "";
29
- const fileName = path.parse(fileOrUrl).name;
30
- return { fileOrUrl, fileName };
31
- })();
32
- const isHttpPath = isHttp(fileOrUrl);
33
- const mulmoFilePath = isHttpPath ? "" : getFullPath(baseDirPath, fileOrUrl);
34
- const mulmoFileDirPath = path.dirname(isHttpPath ? baseDirPath : mulmoFilePath);
35
- const imageDirPath = getFullPath(outDirPath, imagedir ?? imageDirName);
36
- const audioDirPath = getFullPath(outDirPath, audiodir ?? audioDirName);
37
- const outputStudioFilePath = getOutputStudioFilePath(outDirPath, fileName);
38
- return { baseDirPath, mulmoFilePath, mulmoFileDirPath, outDirPath, imageDirPath, audioDirPath, isHttpPath, fileOrUrl, outputStudioFilePath, fileName };
39
- };
40
- const fetchScript = async (isHttpPath, mulmoFilePath, fileOrUrl) => {
41
- if (isHttpPath) {
42
- const res = await fetchMulmoScriptFile(fileOrUrl);
43
- if (!res.result || !res.script) {
44
- GraphAILogger.info(`ERROR: HTTP error! ${res.status} ${fileOrUrl}`);
45
- process.exit(1);
46
- }
47
- return res.script;
48
- }
49
- if (!fs.existsSync(mulmoFilePath)) {
50
- GraphAILogger.info(`ERROR: File not exists ${mulmoFilePath}`);
51
- process.exit(1);
52
- }
53
- return readMulmoScriptFile(mulmoFilePath, "ERROR: File does not exist " + mulmoFilePath).mulmoData;
54
- };
55
- export const main = async () => {
56
- const args = getArgs();
57
- const files = getFileObject(args);
58
- const { mulmoFilePath, isHttpPath, fileOrUrl, fileName, outputStudioFilePath } = files;
59
- if (args.v) {
60
- GraphAILogger.info(files);
61
- }
62
- else {
63
- GraphAILogger.setLevelEnabled("error", false);
64
- GraphAILogger.setLevelEnabled("log", false);
65
- GraphAILogger.setLevelEnabled("warn", false);
66
- }
67
- const { action, f: force, pdf_mode, pdf_size, l: lang, c: caption } = args;
68
- const mulmoScript = await fetchScript(isHttpPath, mulmoFilePath, fileOrUrl);
69
- // Create or update MulmoStudio file with MulmoScript
70
- const currentStudio = readMulmoScriptFile(outputStudioFilePath);
71
- const studio = (() => {
72
- try {
73
- // validate mulmoStudioSchema. skip if __test_invalid__ is true
74
- return createOrUpdateStudioData(mulmoScript, currentStudio?.mulmoData, fileName);
75
- }
76
- catch (error) {
77
- GraphAILogger.info(`Error: invalid MulmoScript Schema: ${isHttpPath ? fileOrUrl : mulmoFilePath} \n ${error}`);
78
- process.exit(1);
79
- }
80
- })();
81
- const context = {
82
- studio,
83
- fileDirs: files,
84
- force: Boolean(force),
85
- lang: lang,
86
- caption: caption,
87
- };
88
- if (action === "translate" || lang || caption) {
89
- GraphAILogger.log("run translate");
90
- await translate(context);
91
- }
92
- if (action === "audio") {
93
- await audio(context);
94
- }
95
- if (action === "images") {
96
- await images(context);
97
- }
98
- if (action === "movie") {
99
- if (caption) {
100
- await captions(context);
101
- }
102
- await audio(context);
103
- await images(context);
104
- await movie(context);
105
- }
106
- if (action === "pdf") {
107
- await images(context);
108
- await pdf(context, pdf_mode, pdf_size);
109
- }
110
- if (context.studio.script.title) {
111
- GraphAILogger.info(context.studio.script.title);
112
- }
113
- if (context.studio.script.references) {
114
- const textOutput = context.studio.script.references.map((reference) => `${reference.title}\n${reference.url}`).join("\n");
115
- GraphAILogger.info(textOutput);
116
- }
117
- };
package/lib/cli/run.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/lib/cli/run.js DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { main } from "./cli.js";
3
- main();
@@ -1,16 +0,0 @@
1
- export declare const args: {
2
- [x: string]: unknown;
3
- v: boolean;
4
- o: string | undefined;
5
- b: string | undefined;
6
- l: string | undefined;
7
- u: string[] | never[];
8
- i: boolean | undefined;
9
- t: string | undefined;
10
- c: string | undefined;
11
- s: string;
12
- llm_agent: string | undefined;
13
- llm_model: string | undefined;
14
- _: (string | number)[];
15
- $0: string;
16
- };
@@ -1,64 +0,0 @@
1
- import yargs from "yargs";
2
- import { hideBin } from "yargs/helpers";
3
- import { commonOptions } from "./common.js";
4
- import { getAvailableTemplates } from "../utils/file.js";
5
- import { llmAgents } from "../utils/utils.js";
6
- const availableTemplateNames = getAvailableTemplates().map((template) => template.filename);
7
- export const args = commonOptions(yargs(hideBin(process.argv)))
8
- .scriptName("mulmo-tool")
9
- .option("u", {
10
- alias: "url",
11
- description: "URLs to reference (required when not in interactive mode)",
12
- demandOption: false,
13
- default: [],
14
- type: "array",
15
- string: true,
16
- })
17
- .option("i", {
18
- alias: "interactive",
19
- description: "Generate script in interactive mode with user prompts",
20
- demandOption: false,
21
- type: "boolean",
22
- })
23
- .option("t", {
24
- alias: "template",
25
- description: "Template name to use",
26
- demandOption: false,
27
- choices: availableTemplateNames,
28
- type: "string",
29
- })
30
- .option("c", {
31
- alias: "cache",
32
- description: "cache dir",
33
- demandOption: false,
34
- type: "string",
35
- })
36
- .option("s", {
37
- alias: "script",
38
- description: "script filename",
39
- demandOption: false,
40
- default: "script",
41
- type: "string",
42
- })
43
- .option("llm_agent", {
44
- description: "llm agent",
45
- demandOption: false,
46
- choices: llmAgents,
47
- type: "string",
48
- })
49
- .option("llm_model", {
50
- description: "llm model",
51
- demandOption: false,
52
- type: "string",
53
- })
54
- .command("$0 <action>", "Run mulmocast tool", (yargs) => {
55
- return yargs.positional("action", {
56
- describe: "action to perform",
57
- choices: ["scripting", "prompt", "schema"],
58
- type: "string",
59
- });
60
- })
61
- .strict()
62
- .help()
63
- .alias("help", "h")
64
- .parseSync();
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import "dotenv/config";
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- import "dotenv/config";
3
- import yargs from "yargs/yargs";
4
- import { hideBin } from "yargs/helpers";
5
- import { GraphAILogger } from "graphai";
6
- import * as scriptingCmd from "./tool_commands/scripting/index.js";
7
- import * as promptCmd from "./tool_commands/prompt/index.js";
8
- import * as schemaCmd from "./tool_commands/schema/index.js";
9
- const cli = yargs(hideBin(process.argv))
10
- .scriptName("mulmo-tool")
11
- .usage("$0 <command> [args]")
12
- .option("v", {
13
- alias: "verbose",
14
- describe: "verbose log",
15
- demandOption: true,
16
- default: false,
17
- type: "boolean",
18
- })
19
- .command(scriptingCmd)
20
- .command(promptCmd)
21
- .command(schemaCmd)
22
- .demandCommand()
23
- .strict()
24
- .help()
25
- .alias("help", "h");
26
- const main = async () => {
27
- await cli.parseAsync();
28
- };
29
- main().catch((error) => {
30
- GraphAILogger.info("An unexpected error occurred:", error);
31
- process.exit(1);
32
- });
@@ -1,4 +0,0 @@
1
- import { Argv } from "yargs";
2
- export declare const builder: (yargs: Argv) => Argv<{
3
- t: string | undefined;
4
- }>;
@@ -1,11 +0,0 @@
1
- import { getAvailableTemplates } from "@/src/utils/file.js";
2
- const availableTemplateNames = getAvailableTemplates().map((template) => template.filename);
3
- export const builder = (yargs) => {
4
- return yargs.option("t", {
5
- alias: "template",
6
- describe: "Template name to use",
7
- demandOption: false,
8
- choices: availableTemplateNames,
9
- type: "string",
10
- });
11
- };
@@ -1,4 +0,0 @@
1
- import { ToolCliArgs } from "@/src/types/cli_types.js";
2
- export declare const handler: (argv: ToolCliArgs<{
3
- template?: string;
4
- }>) => Promise<void>;
@@ -1,14 +0,0 @@
1
- import { selectTemplate } from "@/src/utils/inquirer.js";
2
- import { dumpPromptFromTemplate } from "../../../tools/dump_prompt.js";
3
- import { setGraphAILogger } from "@/src/utils/cli.js";
4
- export const handler = async (argv) => {
5
- let { template } = argv;
6
- const { v: verbose } = argv;
7
- if (!template) {
8
- template = await selectTemplate();
9
- }
10
- setGraphAILogger(verbose, {
11
- template,
12
- });
13
- await dumpPromptFromTemplate({ templateName: template });
14
- };
@@ -1,4 +0,0 @@
1
- export declare const command = "prompt";
2
- export declare const desc = "Dump prompt from template";
3
- export { builder } from "./builder.js";
4
- export { handler } from "./handler.js";
@@ -1,4 +0,0 @@
1
- export const command = "prompt";
2
- export const desc = "Dump prompt from template";
3
- export { builder } from "./builder.js";
4
- export { handler } from "./handler.js";
@@ -1,2 +0,0 @@
1
- import { Argv } from "yargs";
2
- export declare const builder: (yargs: Argv) => Argv<{}>;
@@ -1,3 +0,0 @@
1
- export const builder = (yargs) => {
2
- return yargs;
3
- };
@@ -1,2 +0,0 @@
1
- import { ToolCliArgs } from "@/src/types/cli_types.js";
2
- export declare const handler: (argv: ToolCliArgs) => Promise<void>;
@@ -1,12 +0,0 @@
1
- import { mulmoScriptSchema } from "@/src/types/schema.js";
2
- import { zodToJsonSchema } from "zod-to-json-schema";
3
- import { GraphAILogger } from "graphai";
4
- import { setGraphAILogger } from "@/src/utils/cli.js";
5
- export const handler = async (argv) => {
6
- const { v: verbose } = argv;
7
- setGraphAILogger(verbose);
8
- const defaultSchema = zodToJsonSchema(mulmoScriptSchema, {
9
- strictUnions: true,
10
- });
11
- GraphAILogger.info(JSON.stringify(defaultSchema, null, 2));
12
- };
@@ -1,4 +0,0 @@
1
- export declare const command = "schema";
2
- export declare const desc = "Dump mulmocast schema";
3
- export { builder } from "./builder.js";
4
- export { handler } from "./handler.js";
@@ -1,4 +0,0 @@
1
- export const command = "schema";
2
- export const desc = "Dump mulmocast schema";
3
- export { builder } from "./builder.js";
4
- export { handler } from "./handler.js";
@@ -1,20 +0,0 @@
1
- import { Argv } from "yargs";
2
- export declare const builder: (yargs: Argv) => Argv<{
3
- o: string | undefined;
4
- } & {
5
- b: string | undefined;
6
- } & {
7
- u: string[] | never[];
8
- } & {
9
- i: boolean | undefined;
10
- } & {
11
- t: string | undefined;
12
- } & {
13
- c: string | undefined;
14
- } & {
15
- s: string;
16
- } & {
17
- llm_agent: string | undefined;
18
- } & {
19
- llm_model: string | undefined;
20
- }>;
@@ -1,63 +0,0 @@
1
- import { llmAgents } from "../../../utils/utils.js";
2
- import { getAvailableTemplates } from "../../../utils/file.js";
3
- const availableTemplateNames = getAvailableTemplates().map((template) => template.filename);
4
- export const builder = (yargs) => {
5
- return yargs
6
- .option("o", {
7
- alias: "outdir",
8
- description: "output dir",
9
- demandOption: false,
10
- type: "string",
11
- })
12
- .option("b", {
13
- alias: "basedir",
14
- description: "base dir",
15
- demandOption: false,
16
- type: "string",
17
- })
18
- .option("u", {
19
- alias: "url",
20
- description: "URLs to reference (required when not in interactive mode)",
21
- demandOption: false,
22
- default: [],
23
- type: "array",
24
- string: true,
25
- })
26
- .option("i", {
27
- alias: "interactive",
28
- description: "Generate script in interactive mode with user prompts",
29
- demandOption: false,
30
- type: "boolean",
31
- })
32
- .option("t", {
33
- alias: "template",
34
- description: "Template name to use",
35
- demandOption: false,
36
- choices: availableTemplateNames,
37
- type: "string",
38
- })
39
- .option("c", {
40
- alias: "cache",
41
- description: "cache dir",
42
- demandOption: false,
43
- type: "string",
44
- })
45
- .option("s", {
46
- alias: "script",
47
- description: "script filename",
48
- demandOption: false,
49
- default: "script",
50
- type: "string",
51
- })
52
- .option("llm_agent", {
53
- description: "llm agent",
54
- demandOption: false,
55
- choices: llmAgents,
56
- type: "string",
57
- })
58
- .option("llm_model", {
59
- description: "llm model",
60
- demandOption: false,
61
- type: "string",
62
- });
63
- };
@@ -1,12 +0,0 @@
1
- import { ToolCliArgs } from "@/src/types/cli_types.js";
2
- export declare const handler: (argv: ToolCliArgs<{
3
- o?: string;
4
- b?: string;
5
- u?: string[];
6
- i?: boolean;
7
- t?: string;
8
- c?: string;
9
- s?: string;
10
- llm_agent?: string;
11
- llm_model?: string;
12
- }>) => Promise<void>;
@@ -1,36 +0,0 @@
1
- import { getBaseDirPath, getFullPath } from "@/src/utils/file.js";
2
- import { outDirName, cacheDirName } from "../../../utils/const.js";
3
- import { getUrlsIfNeeded, selectTemplate } from "@/src/utils/inquirer.js";
4
- import { createMulmoScriptFromUrl } from "../../../tools/create_mulmo_script_from_url.js";
5
- import { createMulmoScriptInteractively } from "../../../tools/create_mulmo_script_interactively.js";
6
- import { setGraphAILogger } from "@/src/utils/cli.js";
7
- export const handler = async (argv) => {
8
- const { o: outdir, b: basedir, v: verbose, i: interactive, c: cache, s: filename, llm_agent, llm_model } = argv;
9
- let { t: template } = argv;
10
- const urls = argv.u || [];
11
- const baseDirPath = getBaseDirPath(basedir);
12
- const outDirPath = getFullPath(baseDirPath, outdir ?? outDirName);
13
- const cacheDirPath = getFullPath(outDirPath, cache ?? cacheDirName);
14
- if (!template) {
15
- template = await selectTemplate();
16
- }
17
- setGraphAILogger(verbose, {
18
- baseDirPath,
19
- outDirPath,
20
- cacheDirPath,
21
- template,
22
- urls,
23
- interactive,
24
- filename,
25
- llm_agent,
26
- llm_model,
27
- });
28
- const context = { outDirPath, templateName: template, urls, filename: filename, cacheDirPath, llm_model, llm_agent };
29
- if (interactive) {
30
- await createMulmoScriptInteractively(context);
31
- }
32
- else {
33
- context.urls = await getUrlsIfNeeded(urls);
34
- await createMulmoScriptFromUrl(context);
35
- }
36
- };
@@ -1,4 +0,0 @@
1
- export declare const command = "scripting";
2
- export declare const desc = "Generate mulmocast script";
3
- export { builder } from "./builder.js";
4
- export { handler } from "./handler.js";
@@ -1,4 +0,0 @@
1
- export const command = "scripting";
2
- export const desc = "Generate mulmocast script";
3
- export { builder } from "./builder.js";
4
- export { handler } from "./handler.js";
package/lib/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from "./actions/index.js";
2
- export * from "./cli/helpers.js";
3
- export * from "./utils/file.js";
4
- export * from "./utils/ffmpeg_utils.js";
5
- export * from "./utils/provider2agent.js";
6
- export * from "./methods/index.js";
7
- export * from "./agents/index.js";
8
- export * from "./types/index.js";
package/lib/index.js DELETED
@@ -1,8 +0,0 @@
1
- export * from "./actions/index.js";
2
- export * from "./cli/helpers.js";
3
- export * from "./utils/file.js";
4
- export * from "./utils/ffmpeg_utils.js";
5
- export * from "./utils/provider2agent.js";
6
- export * from "./methods/index.js";
7
- export * from "./agents/index.js";
8
- export * from "./types/index.js";
@@ -1,4 +0,0 @@
1
- import { MulmoScript, MulmoScriptTemplate } from "../types/index.js";
2
- export declare const MulmoScriptTemplateMethods: {
3
- getSystemPrompt(template: MulmoScriptTemplate, script?: MulmoScript): string;
4
- };
@@ -1,6 +0,0 @@
1
- import { getMulmoScriptTemplateSystemPrompt } from "../utils/prompt.js";
2
- export const MulmoScriptTemplateMethods = {
3
- getSystemPrompt(template, script) {
4
- return getMulmoScriptTemplateSystemPrompt(template, script);
5
- },
6
- };
@@ -1,8 +0,0 @@
1
- import { MulmoStudio } from "../types/index.js";
2
- type SessionType = "audio" | "image" | "video" | "multiLingual" | "caption" | "pdf";
3
- type BeatSessionType = "audio" | "image" | "multiLingual" | "caption" | "movie";
4
- export declare const MulmoStudioMethods: {
5
- setSessionState(studio: MulmoStudio, sessionType: SessionType, value: boolean): void;
6
- setBeatSessionState(studio: MulmoStudio, sessionType: BeatSessionType, index: number, value: boolean): void;
7
- };
8
- export {};
@@ -1,25 +0,0 @@
1
- import { GraphAILogger } from "graphai";
2
- const notifyStateChange = (studio, sessionType) => {
3
- const prefix = studio.state.inSession[sessionType] ? "<" : " >";
4
- GraphAILogger.info(`${prefix} ${sessionType}`);
5
- };
6
- const notifyBeatStateChange = (studio, sessionType, index) => {
7
- const prefix = studio.state.inBeatSession[sessionType][index] ? "{" : " }";
8
- GraphAILogger.info(`${prefix} ${sessionType} ${index}`);
9
- };
10
- export const MulmoStudioMethods = {
11
- setSessionState(studio, sessionType, value) {
12
- studio.state.inSession[sessionType] = value;
13
- notifyStateChange(studio, sessionType);
14
- },
15
- setBeatSessionState(studio, sessionType, index, value) {
16
- if (value) {
17
- studio.state.inBeatSession[sessionType][index] = true;
18
- }
19
- else {
20
- // NOTE: Setting to false causes the parse error in rebuildStudio in preprocess.ts
21
- delete studio.state.inBeatSession[sessionType][index];
22
- }
23
- notifyBeatStateChange(studio, sessionType, index);
24
- },
25
- };
@@ -1,13 +0,0 @@
1
- import type { ContentBlock, TableCellValue } from "./schema.js";
2
- export declare const resolveCellColor: (cellObj: {
3
- color?: string;
4
- }, isRowHeader: boolean) => string;
5
- export declare const renderBadge: (text: string, color: string) => string;
6
- export declare const renderCellValue: (cell: TableCellValue, isRowHeader: boolean) => string;
7
- export declare const renderTableCore: (headers: string[] | undefined, rows: TableCellValue[][], rowHeaders?: boolean, striped?: boolean) => string;
8
- /** Render a single content block to HTML */
9
- export declare const renderContentBlock: (block: ContentBlock) => string;
10
- /** Render an array of content blocks to HTML */
11
- export declare const renderContentBlocks: (blocks: ContentBlock[]) => string;
12
- /** Render content blocks with fixed aspect-ratio container for image blocks (used in card layouts) */
13
- export declare const renderCardContentBlocks: (blocks: ContentBlock[]) => string;