mulmocast 0.0.23 → 0.0.25

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.
@@ -87,13 +87,7 @@ export const mulmoTextSlideMediaSchema = z
87
87
  export const mulmoCaptionParamsSchema = z
88
88
  .object({
89
89
  lang: langSchema.optional(),
90
- textColor: z.string().default("#FFFFFF"),
91
- backgroundColor: z.string().default("#000000"),
92
- fontSize: z.number().default(16),
93
- fontFamily: z.string().default("Arial"),
94
- fontWeight: z.string().default("normal"),
95
- textAlign: z.string().default("left"),
96
- textDecoration: z.string().default("none"),
90
+ styles: z.array(z.string()).default([]), // css styles
97
91
  })
98
92
  .strict();
99
93
  export const mulmoChartMediaSchema = z
@@ -83,6 +83,7 @@ export type Text2HtmlAgentInfo = {
83
83
  provider: Text2HtmlImageProvider;
84
84
  agent: string;
85
85
  model: string;
86
+ max_tokens: number;
86
87
  };
87
88
  export type BeatMediaType = "movie" | "image";
88
89
  export type StoryToScriptGenerateMode = (typeof storyToScriptGenerateMode)[keyof typeof storyToScriptGenerateMode];
@@ -217,13 +217,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
217
217
  cssStyles: string | string[];
218
218
  } | undefined;
219
219
  captionParams?: {
220
- textColor: string;
221
- backgroundColor: string;
222
- fontSize: number;
223
- fontFamily: string;
224
- fontWeight: string;
225
- textAlign: string;
226
- textDecoration: string;
220
+ styles: string[];
227
221
  lang?: string | undefined;
228
222
  } | undefined;
229
223
  imageNames?: string[] | undefined;
@@ -280,13 +274,7 @@ export declare const createOrUpdateStudioData: (_mulmoScript: MulmoScript, curre
280
274
  cssStyles: string | string[];
281
275
  } | undefined;
282
276
  captionParams?: {
283
- textColor: string;
284
- backgroundColor: string;
285
- fontSize: number;
286
- fontFamily: string;
287
- fontWeight: string;
288
- textAlign: string;
289
- textDecoration: string;
277
+ styles: string[];
290
278
  lang?: string | undefined;
291
279
  } | undefined;
292
280
  references?: {
@@ -1,4 +1,4 @@
1
- import { MulmoBeat, MulmoScript, MulmoScriptTemplate, MulmoStoryboard } from "../types/index.js";
1
+ import { MulmoBeat, MulmoScript, MulmoScriptTemplate, MulmoStoryboard, MulmoCanvasDimension } from "../types/index.js";
2
2
  export declare const imagePrompt: (beat: MulmoBeat, style?: string) => string;
3
3
  export declare const graphDataScriptFromUrlPrompt: (sourceTextInput: string) => string;
4
4
  export declare const graphDataScriptGeneratePrompt: (scene: string) => string;
@@ -17,3 +17,4 @@ export declare const storyToScriptPrompt: (script: MulmoScript, beatsPerScene: n
17
17
  export declare const searchQueryPrompt: (inquiry: string, followUpQueries: string) => string;
18
18
  export declare const reflectionPrompt: (researchTopic: string, searchResults: string) => string;
19
19
  export declare const finalAnswerPrompt: (userInput: string, searchResults: string, researchTopic: string) => string;
20
+ export declare const htmlImageSystemPrompt: (canvasSize: MulmoCanvasDimension) => string[];
@@ -124,3 +124,13 @@ export const finalAnswerPrompt = (userInput, searchResults, researchTopic) => {
124
124
  Current Date: ${currentDate}
125
125
  `;
126
126
  };
127
+ export const htmlImageSystemPrompt = (canvasSize) => {
128
+ return [
129
+ "Based on the provided information, create a single slide HTML page using Tailwind CSS.",
130
+ `The view port size is ${canvasSize.width}x${canvasSize.height}. Make sure the HTML fits within the view port.`,
131
+ "If charts are needed, use Chart.js to present them in a clean and visually appealing way (with animation:false to disable animation).",
132
+ "Include a balanced mix of comments, graphs, and illustrations to enhance visual impact.",
133
+ "Output only the HTML code. Do not include any comments, explanations, or additional information outside the HTML.",
134
+ "If data is provided, use it effectively to populate the slide.",
135
+ ];
136
+ };
@@ -1,5 +1,6 @@
1
1
  import { MulmoBeat, MulmoStudioMultiLingualData } from "../types/index.js";
2
- export declare const llm: readonly ["openAI", "anthropic", "gemini", "groq"];
2
+ import type { ConfigDataDictionary, DefaultConfigData } from "graphai";
3
+ export declare const llm: readonly ["openai", "anthropic", "gemini", "groq"];
3
4
  export type LLM = (typeof llm)[number];
4
5
  export declare const llmConfig: Record<LLM, {
5
6
  agent: string;
@@ -17,3 +18,4 @@ export declare const text2hash: (input: string) => string;
17
18
  export declare const localizedText: (beat: MulmoBeat, multiLingualData?: MulmoStudioMultiLingualData, lang?: string) => string;
18
19
  export declare const sleep: (milliseconds: number) => Promise<unknown>;
19
20
  export declare function userAssert(condition: boolean, message: string): asserts condition;
21
+ export declare const settings2GraphAIConfig: (settings?: Record<string, string>) => ConfigDataDictionary<DefaultConfigData>;
@@ -1,7 +1,7 @@
1
1
  import * as crypto from "crypto";
2
- export const llm = ["openAI", "anthropic", "gemini", "groq"];
2
+ export const llm = ["openai", "anthropic", "gemini", "groq"];
3
3
  export const llmConfig = {
4
- openAI: {
4
+ openai: {
5
5
  agent: "openAIAgent",
6
6
  defaultModel: "gpt-4o",
7
7
  max_tokens: 8192,
@@ -23,10 +23,10 @@ export const llmConfig = {
23
23
  },
24
24
  };
25
25
  export const llmPair = (_llm, _model) => {
26
- const llmKey = _llm ?? "openAI";
27
- const agent = llmConfig[llmKey]?.agent ?? llmConfig.openAI.agent;
28
- const model = _model ?? llmConfig[llmKey]?.defaultModel ?? llmConfig.openAI.defaultModel;
29
- const max_tokens = llmConfig[llmKey]?.max_tokens ?? llmConfig.openAI.max_tokens;
26
+ const llmKey = _llm ?? "openai";
27
+ const agent = llmConfig[llmKey]?.agent ?? llmConfig.openai.agent;
28
+ const model = _model ?? llmConfig[llmKey]?.defaultModel ?? llmConfig.openai.defaultModel;
29
+ const max_tokens = llmConfig[llmKey]?.max_tokens ?? llmConfig.openai.max_tokens;
30
30
  return { agent, model, max_tokens };
31
31
  };
32
32
  export const chunkArray = (array, size = 3) => {
@@ -60,3 +60,45 @@ export function userAssert(condition, message) {
60
60
  throw new Error(message);
61
61
  }
62
62
  }
63
+ export const settings2GraphAIConfig = (settings) => {
64
+ const config = {};
65
+ if (settings) {
66
+ if (settings.OPENAI_API_KEY) {
67
+ config.openAIAgent = {
68
+ apiKey: settings.OPENAI_API_KEY,
69
+ };
70
+ config.ttsOpenaiAgent = {
71
+ apiKey: settings.OPENAI_API_KEY,
72
+ };
73
+ config.imageOpenaiAgent = {
74
+ apiKey: settings.OPENAI_API_KEY,
75
+ };
76
+ }
77
+ if (settings.ANTHROPIC_API_TOKEN) {
78
+ config.anthropicAgent = {
79
+ apiKey: settings.ANTHROPIC_API_TOKEN,
80
+ };
81
+ }
82
+ if (settings.REPLICATE_API_TOKEN) {
83
+ config.movieReplicateAgent = {
84
+ apiKey: settings.REPLICATE_API_TOKEN,
85
+ };
86
+ }
87
+ if (settings.NIJIVOICE_API_KEY) {
88
+ config.ttsNijivoiceAgent = {
89
+ apiKey: settings.NIJIVOICE_API_KEY,
90
+ };
91
+ }
92
+ if (settings.ELEVENLABS_API_KEY) {
93
+ config.ttsElevenlabsAgent = {
94
+ apiKey: settings.ELEVENLABS_API_KEY,
95
+ };
96
+ }
97
+ // TODO
98
+ // browserlessAgent
99
+ // ttsGoogleAgent
100
+ // geminiAgent, groqAgent for tool
101
+ // TAVILY_API_KEY ( for deep research)
102
+ }
103
+ return config;
104
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -68,22 +68,22 @@
68
68
  "@graphai/stream_agent_filter": "^2.0.2",
69
69
  "@graphai/vanilla": "^2.0.4",
70
70
  "@graphai/vanilla_node_agents": "^2.0.1",
71
- "@tavily/core": "^0.5.7",
72
- "canvas": "^3.1.0",
71
+ "@tavily/core": "^0.5.8",
72
+ "canvas": "^3.1.2",
73
73
  "clipboardy": "^4.0.0",
74
- "dotenv": "^16.4.7",
74
+ "dotenv": "^17.0.0",
75
75
  "fluent-ffmpeg": "^2.1.3",
76
76
  "google-auth-library": "^9.15.1",
77
77
  "graphai": "^2.0.9",
78
- "inquirer": "^12.6.1",
78
+ "inquirer": "^12.6.3",
79
79
  "marked": "^15.0.12",
80
80
  "ora": "^8.2.0",
81
- "puppeteer": "^24.10.2",
81
+ "puppeteer": "^24.11.0",
82
82
  "replicate": "^1.0.1",
83
83
  "yaml": "^2.8.0",
84
84
  "yargs": "^17.7.2",
85
85
  "zod": "^3.25.67",
86
- "zod-to-json-schema": "^3.24.5"
86
+ "zod-to-json-schema": "^3.24.6"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@anatine/zod-mock": "^3.14.0",
@@ -91,14 +91,14 @@
91
91
  "@receptron/test_utils": "^2.0.0",
92
92
  "@types/fluent-ffmpeg": "^2.1.26",
93
93
  "@types/yargs": "^17.0.33",
94
- "eslint": "^9.29.0",
94
+ "eslint": "^9.30.0",
95
95
  "eslint-config-prettier": "^10.1.5",
96
- "eslint-plugin-prettier": "^5.5.0",
97
- "prettier": "^3.3.3",
96
+ "eslint-plugin-prettier": "^5.5.1",
97
+ "prettier": "^3.6.2",
98
98
  "ts-node": "^10.9.2",
99
99
  "tsx": "^4.20.3",
100
100
  "typescript": "^5.7.3",
101
- "typescript-eslint": "^8.34.1"
101
+ "typescript-eslint": "^8.35.0"
102
102
  },
103
103
  "engines": {
104
104
  "node": ">=18.0.0"